Skip to content

Commit

Permalink
Move classes inside the main class; non-nested static classes are a b…
Browse files Browse the repository at this point in the history
…it annoying in an IDE
  • Loading branch information
bstansberry committed Mar 23, 2016
1 parent 8a9617e commit 2041027
Showing 1 changed file with 34 additions and 34 deletions.
Expand Up @@ -289,47 +289,47 @@ public void registerChildren(ManagementResourceRegistration resourceRegistration
}
}
}
}

final class AttributeBinding {
private final AttributeDefinition attribute;
private final OperationStepHandler readOp;
private final OperationStepHandler writeOp;
private final AttributeAccess.AccessType accessType;

AttributeBinding(AttributeDefinition attribute, OperationStepHandler readOp, OperationStepHandler writeOp, AttributeAccess.AccessType accessType) {
this.attribute = attribute;
this.readOp = readOp;
this.writeOp = writeOp;
this.accessType = accessType;
}

void register(ManagementResourceRegistration registration) {
if (accessType == AttributeAccess.AccessType.READ_ONLY) {
registration.registerReadOnlyAttribute(attribute, readOp);
} else if (accessType == AttributeAccess.AccessType.READ_WRITE) {
registration.registerReadWriteAttribute(attribute, readOp, writeOp);
} else if (accessType == AttributeAccess.AccessType.METRIC) {
registration.registerMetric(attribute, readOp);
private static final class AttributeBinding {
private final AttributeDefinition attribute;
private final OperationStepHandler readOp;
private final OperationStepHandler writeOp;
private final AttributeAccess.AccessType accessType;

AttributeBinding(AttributeDefinition attribute, OperationStepHandler readOp, OperationStepHandler writeOp, AttributeAccess.AccessType accessType) {
this.attribute = attribute;
this.readOp = readOp;
this.writeOp = writeOp;
this.accessType = accessType;
}

void register(ManagementResourceRegistration registration) {
if (accessType == AttributeAccess.AccessType.READ_ONLY) {
registration.registerReadOnlyAttribute(attribute, readOp);
} else if (accessType == AttributeAccess.AccessType.READ_WRITE) {
registration.registerReadWriteAttribute(attribute, readOp, writeOp);
} else if (accessType == AttributeAccess.AccessType.METRIC) {
registration.registerMetric(attribute, readOp);
}
}

}

}
private static final class OperationBinding {
private OperationDefinition definition;
private OperationStepHandler handler;
private boolean inherited;

final class OperationBinding {
private OperationDefinition definition;
private OperationStepHandler handler;
private boolean inherited;
OperationBinding(OperationDefinition definition, OperationStepHandler handler, boolean inherited) {
this.definition = definition;
this.handler = handler;
this.inherited = inherited;
}

OperationBinding(OperationDefinition definition, OperationStepHandler handler, boolean inherited) {
this.definition = definition;
this.handler = handler;
this.inherited = inherited;
public void register(ManagementResourceRegistration registration) {
registration.registerOperationHandler(definition, handler, inherited);
}
}

public void register(ManagementResourceRegistration registration) {
registration.registerOperationHandler(definition, handler, inherited);
}
}


0 comments on commit 2041027

Please sign in to comment.