X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fconfig%2Fyang-jmx-generator%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Fyangjmxgenerator%2Fattribute%2FListAttribute.java;fp=opendaylight%2Fconfig%2Fyang-jmx-generator%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Fyangjmxgenerator%2Fattribute%2FListAttribute.java;h=23c4c228357ad2caee22d2880e0aff3605758839;hp=9d8996369db59867b63b6c7808879bdbbf46fd92;hb=db89afdefb3cfa4454dfdc6008e1d54d3ede66fb;hpb=0ac8d08952b78b20738683e806085609aced5932 diff --git a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/ListAttribute.java b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/ListAttribute.java index 9d8996369d..23c4c22835 100644 --- a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/ListAttribute.java +++ b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/ListAttribute.java @@ -12,8 +12,8 @@ import javax.management.openmbean.ArrayType; import javax.management.openmbean.OpenDataException; import javax.management.openmbean.OpenType; import org.opendaylight.controller.config.yangjmxgenerator.TypeProviderWrapper; -import org.opendaylight.yangtools.binding.generator.util.Types; -import org.opendaylight.yangtools.sal.binding.model.api.Type; +import org.opendaylight.mdsal.binding.generator.util.Types; +import org.opendaylight.mdsal.binding.model.api.Type; import org.opendaylight.yangtools.yang.model.api.DataSchemaNode; import org.opendaylight.yangtools.yang.model.api.LeafListSchemaNode; import org.opendaylight.yangtools.yang.model.api.ListSchemaNode; @@ -23,24 +23,24 @@ public class ListAttribute extends AbstractAttribute implements TypedAttribute { private final String nullableDescription, nullableDefault; private final TypedAttribute innerAttribute; - public static ListAttribute create(ListSchemaNode node, - TypeProviderWrapper typeProvider, String packageName) { + public static ListAttribute create(final ListSchemaNode node, + final TypeProviderWrapper typeProvider, final String packageName) { - TOAttribute innerAttribute = TOAttribute.create(node, typeProvider, packageName); + final TOAttribute innerAttribute = TOAttribute.create(node, typeProvider, packageName); return new ListAttribute(node, innerAttribute, node.getDescription()); } - public static ListAttribute create(LeafListSchemaNode node, - TypeProviderWrapper typeProvider) { + public static ListAttribute create(final LeafListSchemaNode node, + final TypeProviderWrapper typeProvider) { - JavaAttribute innerAttribute = new JavaAttribute(node, typeProvider); + final JavaAttribute innerAttribute = new JavaAttribute(node, typeProvider); return new ListAttribute(node, innerAttribute, node.getDescription()); } - ListAttribute(DataSchemaNode attrNode, TypedAttribute innerAttribute, - String description) { + ListAttribute(final DataSchemaNode attrNode, final TypedAttribute innerAttribute, + final String description) { super(attrNode); this.nullableDescription = description; this.innerAttribute = innerAttribute; @@ -49,55 +49,55 @@ public class ListAttribute extends AbstractAttribute implements TypedAttribute { @Override public String getNullableDescription() { - return nullableDescription; + return this.nullableDescription; } @Override public String getNullableDefault() { - return nullableDefault; + return this.nullableDefault; } public AttributeIfc getInnerAttribute() { - return innerAttribute; + return this.innerAttribute; } @Override public String toString() { return "ListAttribute{" + getAttributeYangName() + "," + "to=" - + innerAttribute + '}'; + + this.innerAttribute + '}'; } @Override public int hashCode() { int result = super.hashCode(); - result = 31 - * result - + (nullableDescription != null ? nullableDescription.hashCode() + result = (31 + * result) + + (this.nullableDescription != null ? this.nullableDescription.hashCode() : 0); - result = 31 * result - + (nullableDefault != null ? nullableDefault.hashCode() : 0); + result = (31 * result) + + (this.nullableDefault != null ? this.nullableDefault.hashCode() : 0); return result; } @Override - public boolean equals(Object o) { + public boolean equals(final Object o) { if (this == o) { return true; } - if (o == null || getClass() != o.getClass()) { + if ((o == null) || (getClass() != o.getClass())) { return false; } if (!super.equals(o)) { return false; } - ListAttribute that = (ListAttribute) o; + final ListAttribute that = (ListAttribute) o; - if (nullableDefault != null ? !nullableDefault + if (this.nullableDefault != null ? !this.nullableDefault .equals(that.nullableDefault) : that.nullableDefault != null) { return false; } - if (nullableDescription != null ? !nullableDescription + if (this.nullableDescription != null ? !this.nullableDescription .equals(that.nullableDescription) : that.nullableDescription != null) { return false; @@ -109,19 +109,19 @@ public class ListAttribute extends AbstractAttribute implements TypedAttribute { @Override public Type getType() { - return Types.parameterizedTypeFor(Types.typeForClass(List.class), innerAttribute.getType()); + return Types.parameterizedTypeFor(Types.typeForClass(List.class), this.innerAttribute.getType()); } @Override public ArrayType getOpenType() { - OpenType innerOpenType = innerAttribute.getOpenType(); + final OpenType innerOpenType = this.innerAttribute.getOpenType(); return constructArrayType(innerOpenType); } - static ArrayType constructArrayType(OpenType innerOpenType){ + static ArrayType constructArrayType(final OpenType innerOpenType){ try { return new ArrayType<>(1, innerOpenType); - } catch (OpenDataException e) { + } catch (final OpenDataException e) { throw new RuntimeException("Unable to create " + ArrayType.class + " with inner element of type " + innerOpenType, e); }