Refactored implementation of getBaseType method for yang built-in types. 98/1198/1
authorMartin Vitez <mvitez@cisco.com>
Mon, 16 Sep 2013 14:03:18 +0000 (16:03 +0200)
committerMartin Vitez <mvitez@cisco.com>
Mon, 16 Sep 2013 14:03:18 +0000 (16:03 +0200)
Method now returns null instead of reference to itself.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
24 files changed:
code-generator/binding-generator-impl/src/main/java/org/opendaylight/yangtools/sal/binding/generator/impl/BindingGeneratorImpl.xtend
code-generator/binding-generator-impl/src/main/java/org/opendaylight/yangtools/sal/binding/yang/types/TypeProviderImpl.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/AbstractSignedInteger.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/AbstractUnsignedInteger.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/BinaryType.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/BitsType.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/BooleanType.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/Decimal64.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/EmptyType.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/EnumerationType.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/IdentityrefType.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/InstanceIdentifier.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/Int16.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/Int32.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/Int64.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/Int8.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/Leafref.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/StringType.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/Uint16.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/Uint32.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/Uint64.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/Uint8.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/UnionType.java
yang/yang-model-util/src/test/java/org/opendaylight/yangtools/yang/model/util/Int8Test.java

index 364785dede5fbf0a198a59dce14754f6517d912d..8bc95f38a5ef49a40d65580855dee7f90ea0d46c 100644 (file)
@@ -1358,7 +1358,7 @@ public class BindingGeneratorImpl implements BindingGenerator {
                                var Type returnType = null;
                                if (typeDef instanceof EnumTypeDefinition) {
                                        returnType = typeProvider.javaTypeForSchemaDefinitionType(typeDef, leaf);
-                                       val enumTypeDef = enumTypeDefFromExtendedType(typeDef);
+                                       val enumTypeDef = typeDef as EnumTypeDefinition;
                                        val enumBuilder = resolveInnerEnumFromTypeDefinition(enumTypeDef, leafName, typeBuilder);
 
                                        if (enumBuilder !== null) {
@@ -1875,7 +1875,7 @@ public class BindingGeneratorImpl implements BindingGenerator {
                if (typeDef instanceof UnionTypeDefinition) {
                        genTOBuilders.addAll(
                                (typeProvider as TypeProviderImpl).
-                                       provideGeneratedTOBuildersForUnionTypeDef(packageName, typeDef, classNameFromLeaf, leaf));
+                                       provideGeneratedTOBuildersForUnionTypeDef(packageName, (typeDef as UnionTypeDefinition), classNameFromLeaf, leaf));
                } else if (typeDef instanceof BitsTypeDefinition) {
                        genTOBuilders.add(
                                ((typeProvider as TypeProviderImpl) ).
index fe3d6e1236fc5274c5157ffab9680303260ccbf9..d39fcff75c53164c2bcc083e3b81690a959bd402 100644 (file)
@@ -7,13 +7,8 @@
  */
 package org.opendaylight.yangtools.sal.binding.yang.types;
 
-import static org.opendaylight.yangtools.binding.generator.util.BindingGeneratorUtil.moduleNamespaceToPackageName;
-import static org.opendaylight.yangtools.binding.generator.util.BindingGeneratorUtil.packageNameForGeneratedType;
-import static org.opendaylight.yangtools.binding.generator.util.BindingGeneratorUtil.parseToClassName;
-import static org.opendaylight.yangtools.binding.generator.util.BindingGeneratorUtil.parseToValidParamName;
-import static org.opendaylight.yangtools.yang.model.util.SchemaContextUtil.findDataSchemaNode;
-import static org.opendaylight.yangtools.yang.model.util.SchemaContextUtil.findDataSchemaNodeForRelativeXPath;
-import static org.opendaylight.yangtools.yang.model.util.SchemaContextUtil.findParentModule;
+import static org.opendaylight.yangtools.binding.generator.util.BindingGeneratorUtil.*;
+import static org.opendaylight.yangtools.yang.model.util.SchemaContextUtil.*;
 
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -82,7 +77,7 @@ public final class TypeProviderImpl implements TypeProvider {
 
     /**
      * Creates new instance of class <code>TypeProviderImpl</code>.
-     * 
+     *
      * @param schemaContext
      *            contains the schema data red from YANG files
      * @throws IllegalArgumentException
@@ -99,7 +94,7 @@ public final class TypeProviderImpl implements TypeProvider {
 
     /**
      * Puts <code>refType</code> to map with key <code>refTypePath</code>
-     * 
+     *
      * @param refTypePath
      *            schema path used as the map key
      * @param refType
@@ -109,20 +104,19 @@ public final class TypeProviderImpl implements TypeProvider {
      *             <li>if <code>refTypePath</code> equal null</li>
      *             <li>if <code>refType</code> equal null</li>
      *             </ul>
-     * 
+     *
      */
     public void putReferencedType(final SchemaPath refTypePath, final Type refType) {
         Preconditions.checkArgument(refTypePath != null,
                 "Path reference of Enumeration Type Definition cannot be NULL!");
-
         Preconditions.checkArgument(refType != null, "Reference to Enumeration Type cannot be NULL!");
         referencedTypes.put(refTypePath, refType);
     }
 
     /**
-     * 
+     *
      * Converts basic YANG type <code>type</code> to JAVA <code>Type</code>.
-     * 
+     *
      * @param type
      *            string with YANG name of type
      * @returns JAVA <code>Type</code> for YANG type <code>type</code>
@@ -137,7 +131,7 @@ public final class TypeProviderImpl implements TypeProvider {
     /**
      * Converts schema definition type <code>typeDefinition</code> to JAVA
      * <code>Type</code>
-     * 
+     *
      * @param typeDefinition
      *            type definition which is converted to JAVA type
      * @throws IllegalArgumentException
@@ -180,7 +174,7 @@ public final class TypeProviderImpl implements TypeProvider {
      * Returns JAVA <code>Type</code> for instances of the type
      * <code>LeafrefTypeDefinition</code> or
      * <code>IdentityrefTypeDefinition</code>.
-     * 
+     *
      * @param typeDefinition
      *            type definition which is converted to JAVA <code>Type</code>
      * @return JAVA <code>Type</code> instance for <code>typeDefinition</code>
@@ -200,7 +194,7 @@ public final class TypeProviderImpl implements TypeProvider {
     /**
      * Returns JAVA <code>Type</code> for instances of the type
      * <code>ExtendedType</code>.
-     * 
+     *
      * @param typeDefinition
      *            type definition which is converted to JAVA <code>Type</code>
      * @return JAVA <code>Type</code> instance for <code>typeDefinition</code>
@@ -241,11 +235,11 @@ public final class TypeProviderImpl implements TypeProvider {
      * Seeks for identity reference <code>idref</code> the JAVA
      * <code>type</code>.<br />
      * <br />
-     * 
+     *
      * <i>Example:<br />
      * If identy which is referenced via <code>idref</code> has name <b>Idn</b>
      * then returning type is <b>{@code Class<? extends Idn>}</b></i>
-     * 
+     *
      * @param idref
      *            identityref type definition for which JAVA <code>Type</code>
      *            is sought
@@ -275,7 +269,7 @@ public final class TypeProviderImpl implements TypeProvider {
 
     /**
      * Converts <code>typeDefinition</code> to concrete JAVA <code>Type</code>.
-     * 
+     *
      * @param typeDefinition
      *            type definition which should be converted to JAVA
      *            <code>Type</code>
@@ -320,7 +314,7 @@ public final class TypeProviderImpl implements TypeProvider {
     /**
      * Gets base type definition for <code>extendTypeDef</code>. The method is
      * recursivelly called until non <code>ExtendedType</code> type is found.
-     * 
+     *
      * @param extendTypeDef
      *            type definition for which is the base type definition sought
      * @return type definition which is base type for <code>extendTypeDef</code>
@@ -340,10 +334,10 @@ public final class TypeProviderImpl implements TypeProvider {
 
     /**
      * Converts <code>leafrefType</code> to JAVA <code>Type</code>.
-     * 
+     *
      * The path of <code>leafrefType</code> is followed to find referenced node
      * and its <code>Type</code> is returned.
-     * 
+     *
      * @param leafrefType
      *            leafref type definition for which is the type sought
      * @return JAVA <code>Type</code> of data schema node which is referenced in
@@ -353,7 +347,7 @@ public final class TypeProviderImpl implements TypeProvider {
      *             <li>if <code>leafrefType</code> equal null</li>
      *             <li>if path statement of <code>leafrefType</code> equal null</li>
      *             </ul>
-     * 
+     *
      */
     public Type provideTypeForLeafref(final LeafrefTypeDefinition leafrefType, final SchemaNode parentNode) {
         Type returnType = null;
@@ -394,7 +388,7 @@ public final class TypeProviderImpl implements TypeProvider {
     /**
      * Checks if <code>dataNode</code> is <code>LeafSchemaNode</code> and if it
      * so then checks if it is of type <code>EnumTypeDefinition</code>.
-     * 
+     *
      * @param dataNode
      *            data schema node for which is checked if it is leaf and if it
      *            is of enum type
@@ -417,7 +411,7 @@ public final class TypeProviderImpl implements TypeProvider {
     /**
      * Checks if <code>dataNode</code> is <code>LeafListSchemaNode</code> and if
      * it so then checks if it is of type <code>EnumTypeDefinition</code>.
-     * 
+     *
      * @param dataNode
      *            data schema node for which is checked if it is leaflist and if
      *            it is of enum type
@@ -442,7 +436,7 @@ public final class TypeProviderImpl implements TypeProvider {
      * Converts <code>enumTypeDef</code> to
      * {@link org.opendaylight.yangtools.sal.binding.model.api.Enumeration
      * enumeration}.
-     * 
+     *
      * @param enumTypeDef
      *            enumeration type definition which is converted to enumeration
      * @param enumName
@@ -479,7 +473,7 @@ public final class TypeProviderImpl implements TypeProvider {
     /**
      * Adds enumeration to <code>typeBuilder</code>. The enumeration data are
      * taken from <code>enumTypeDef</code>.
-     * 
+     *
      * @param enumTypeDef
      *            enumeration type definition is source of enumeration data for
      *            <code>typeBuilder</code>
@@ -497,7 +491,7 @@ public final class TypeProviderImpl implements TypeProvider {
      *             <li>if name of <code>enumTypeDef</code> equal null</li>
      *             <li>if name of <code>typeBuilder</code> equal null</li>
      *             </ul>
-     * 
+     *
      */
     private Enumeration addInnerEnumerationToTypeBuilder(final EnumTypeDefinition enumTypeDef, final String enumName,
             final GeneratedTypeBuilderBase<?> typeBuilder) {
@@ -518,7 +512,7 @@ public final class TypeProviderImpl implements TypeProvider {
 
     /**
      * Converts <code>dataNode</code> to JAVA <code>Type</code>.
-     * 
+     *
      * @param dataNode
      *            contains information about YANG type
      * @return JAVA <code>Type</code> representation of <code>dataNode</code>
@@ -540,7 +534,7 @@ public final class TypeProviderImpl implements TypeProvider {
     /**
      * Passes through all modules and through all its type definitions and
      * convert it to generated types.
-     * 
+     *
      * The modules are firstly sorted by mutual dependencies. The modules are
      * sequentially passed. All type definitions of a module are at the
      * beginning sorted so that type definition with less amount of references
@@ -549,7 +543,7 @@ public final class TypeProviderImpl implements TypeProvider {
      * {@link TypeProviderImpl#genTypeDefsContextMap genTypeDefsContextMap}
      * which map current module name to the map which maps type names to
      * returned types (generated types).
-     * 
+     *
      */
     private void resolveTypeDefsFromContext() {
         final Set<Module> modules = schemaContext.getModules();
@@ -583,7 +577,7 @@ public final class TypeProviderImpl implements TypeProvider {
     }
 
     /**
-     * 
+     *
      * @param basePackageName
      *            string with name of package to which the module belongs
      * @param moduleName
@@ -611,7 +605,7 @@ public final class TypeProviderImpl implements TypeProvider {
                     returnType = provideGeneratedTOFromExtendedType(innerExtendedType, basePackageName, typedefName);
                 } else if (innerTypeDefinition instanceof UnionTypeDefinition) {
                     final GeneratedTOBuilder genTOBuilder = provideGeneratedTOBuilderForUnionTypeDef(basePackageName,
-                            typedef, typedefName, typedef);
+                            (UnionTypeDefinition) innerTypeDefinition, typedefName, typedef);
                     returnType = genTOBuilder.toInstance();
                 } else if (innerTypeDefinition instanceof EnumTypeDefinition) {
                     final EnumTypeDefinition enumTypeDef = (EnumTypeDefinition) innerTypeDefinition;
@@ -643,7 +637,7 @@ public final class TypeProviderImpl implements TypeProvider {
 
     /**
      * Wraps base YANG type to generated TO.
-     * 
+     *
      * @param basePackageName
      *            string with name of package to which the module belongs
      * @param typedef
@@ -675,7 +669,7 @@ public final class TypeProviderImpl implements TypeProvider {
     /**
      * Converts output list of generated TO builders to one TO builder (first
      * from list) which contains the remaining builders as its enclosing TO.
-     * 
+     *
      * @param basePackageName
      *            string with name of package to which the module belongs
      * @param typedef
@@ -687,7 +681,7 @@ public final class TypeProviderImpl implements TypeProvider {
      *         builders
      */
     public GeneratedTOBuilder provideGeneratedTOBuilderForUnionTypeDef(final String basePackageName,
-            final TypeDefinition<?> typedef, String typeDefName, SchemaNode parentNode) {
+            final UnionTypeDefinition typedef, String typeDefName, SchemaNode parentNode) {
         final List<GeneratedTOBuilder> genTOBuilders = provideGeneratedTOBuildersForUnionTypeDef(basePackageName,
                 typedef, typeDefName, parentNode);
         GeneratedTOBuilder resultTOBuilder = null;
@@ -705,7 +699,7 @@ public final class TypeProviderImpl implements TypeProvider {
      * Converts <code>typedef</code> to generated TO with
      * <code>typeDefName</code>. Every union type from <code>typedef</code> is
      * added to generated TO builder as property.
-     * 
+     *
      * @param basePackageName
      *            string with name of package to which the module belongs
      * @param typedef
@@ -722,7 +716,7 @@ public final class TypeProviderImpl implements TypeProvider {
      *             </ul>
      */
     public List<GeneratedTOBuilder> provideGeneratedTOBuildersForUnionTypeDef(final String basePackageName,
-            final TypeDefinition<?> typedef, final String typeDefName, final SchemaNode parentNode) {
+            final UnionTypeDefinition typedef, final String typeDefName, final SchemaNode parentNode) {
         Preconditions.checkArgument(basePackageName != null, "Base Package Name cannot be NULL!");
         Preconditions.checkArgument(typedef != null, "Type Definition cannot be NULL!");
         Preconditions.checkArgument(typedef.getQName() != null,
@@ -730,10 +724,8 @@ public final class TypeProviderImpl implements TypeProvider {
 
         final List<GeneratedTOBuilder> generatedTOBuilders = new ArrayList<>();
 
-        final TypeDefinition<?> baseTypeDefinition = typedef.getBaseType();
-        if ((baseTypeDefinition != null) && (baseTypeDefinition instanceof UnionTypeDefinition)) {
-            final UnionTypeDefinition unionTypeDef = (UnionTypeDefinition) baseTypeDefinition;
-            final List<TypeDefinition<?>> unionTypes = unionTypeDef.getTypes();
+        if (typedef != null) {
+            final List<TypeDefinition<?>> unionTypes = typedef.getTypes();
 
             final GeneratedTOBuilder unionGenTOBuilder;
             if (typeDefName != null && !typeDefName.isEmpty()) {
@@ -748,7 +740,7 @@ public final class TypeProviderImpl implements TypeProvider {
             for (final TypeDefinition<?> unionType : unionTypes) {
                 final String unionTypeName = unionType.getQName().getLocalName();
                 if (unionType instanceof UnionType) {
-                    generatedTOBuilders.addAll(resolveUnionSubtypeAsUnion(unionGenTOBuilder, unionType,
+                    generatedTOBuilders.addAll(resolveUnionSubtypeAsUnion(unionGenTOBuilder, (UnionType) unionType,
                             basePackageName, parentNode));
                 } else if (unionType instanceof ExtendedType) {
                     resolveExtendedSubtypeAsUnion(unionGenTOBuilder, (ExtendedType) unionType, unionTypeName,
@@ -775,14 +767,14 @@ public final class TypeProviderImpl implements TypeProvider {
     /**
      * Wraps code which handle case when union subtype is also of the type
      * <code>UnionType</code>.
-     * 
+     *
      * In this case the new generated TO is created for union subtype (recursive
      * call of method
      * {@link #provideGeneratedTOBuilderForUnionTypeDef(String, TypeDefinition, String)
      * provideGeneratedTOBuilderForUnionTypeDef} and in parent TO builder
      * <code>parentUnionGenTOBuilder</code> is created property which type is
      * equal to new generated TO.
-     * 
+     *
      * @param parentUnionGenTOBuilder
      *            generated TO builder to which is the property with the child
      *            union subtype added
@@ -795,7 +787,7 @@ public final class TypeProviderImpl implements TypeProvider {
      *         <code>provideGeneratedTOBuildersForUnionTypeDef</code> method.
      */
     private List<GeneratedTOBuilder> resolveUnionSubtypeAsUnion(final GeneratedTOBuilder parentUnionGenTOBuilder,
-            final TypeDefinition<?> unionSubtype, final String basePackageName, final SchemaNode parentNode) {
+            final UnionTypeDefinition unionSubtype, final String basePackageName, final SchemaNode parentNode) {
         final String newTOBuilderName = provideAvailableNameForGenTOBuilder(parentUnionGenTOBuilder.getName());
         final List<GeneratedTOBuilder> subUnionGenTOBUilders = provideGeneratedTOBuildersForUnionTypeDef(
                 basePackageName, unionSubtype, newTOBuilderName, parentNode);
@@ -813,11 +805,11 @@ public final class TypeProviderImpl implements TypeProvider {
     /**
      * Wraps code which handle case when union subtype is of the type
      * <code>ExtendedType</code>.
-     * 
+     *
      * If TO for this type already exists it is used for the creation of the
      * property in <code>parentUnionGenTOBuilder</code>. In other case the base
      * type is used for the property creation.
-     * 
+     *
      * @param parentUnionGenTOBuilder
      *            generated TO builder in which new property is created
      * @param unionSubtype
@@ -852,7 +844,7 @@ public final class TypeProviderImpl implements TypeProvider {
     /**
      * Searches for generated TO for <code>searchedTypeDef</code> type
      * definition in {@link #genTypeDefsContextMap genTypeDefsContextMap}
-     * 
+     *
      * @param searchedTypeName
      *            string with name of <code>searchedTypeDef</code>
      * @return generated TO for <code>searchedTypeDef</code> or
@@ -873,7 +865,7 @@ public final class TypeProviderImpl implements TypeProvider {
      * Stores generated TO created from <code>genTOBuilder</code> for
      * <code>newTypeDef</code> to {@link #genTypeDefsContextMap
      * genTypeDefsContextMap} if the module for <code>newTypeDef</code> exists
-     * 
+     *
      * @param newTypeDef
      *            type definition for which is <code>genTOBuilder</code> created
      * @param genTOBuilder
@@ -894,7 +886,7 @@ public final class TypeProviderImpl implements TypeProvider {
     /**
      * Adds a new property with the name <code>propertyName</code> and with type
      * <code>type</code> to <code>unonGenTransObject</code>.
-     * 
+     *
      * @param unionGenTransObject
      *            generated TO to which should be property added
      * @param type
@@ -919,7 +911,7 @@ public final class TypeProviderImpl implements TypeProvider {
 
     /**
      * Converts <code>typedef</code> to the generated TO builder.
-     * 
+     *
      * @param basePackageName
      *            string with name of package to which the module belongs
      * @param typedef
@@ -944,10 +936,10 @@ public final class TypeProviderImpl implements TypeProvider {
     /**
      * Converts <code>typeDef</code> which should be of the type
      * <code>BitsTypeDefinition</code> to <code>GeneratedTOBuilder</code>.
-     * 
+     *
      * All the bits of the typeDef are added to returning generated TO as
      * properties.
-     * 
+     *
      * @param basePackageName
      *            string with name of package to which the module belongs
      * @param typeDef
@@ -994,13 +986,13 @@ public final class TypeProviderImpl implements TypeProvider {
     /**
      * Converts the pattern constraints from <code>typedef</code> to the list of
      * the strings which represents these constraints.
-     * 
+     *
      * @param typedef
      *            extended type in which are the pattern constraints sought
      * @return list of strings which represents the constraint patterns
      * @throws IllegalArgumentException
      *             if <code>typedef</code> equals null
-     * 
+     *
      */
     private List<String> resolveRegExpressionsFromTypedef(ExtendedType typedef) {
         final List<String> regExps = new ArrayList<String>();
@@ -1022,10 +1014,10 @@ public final class TypeProviderImpl implements TypeProvider {
     }
 
     /**
-     * 
+     *
      * Adds to the <code>genTOBuilder</code> the constant which contains regular
      * expressions from the <code>regularExpressions</code>
-     * 
+     *
      * @param genTOBuilder
      *            generated TO builder to which are
      *            <code>regular expressions</code> added
@@ -1055,11 +1047,11 @@ public final class TypeProviderImpl implements TypeProvider {
      * <code>innerExtendedType</code>, about the package name
      * <code>typedefName</code> and about the generated TO name
      * <code>typedefName</code>.
-     * 
+     *
      * It is supposed that <code>innerExtendedType</code> is already present in
      * {@link TypeProviderImpl#genTypeDefsContextMap genTypeDefsContextMap} to
      * be possible set it as extended type for the returning generated TO.
-     * 
+     *
      * @param innerExtendedType
      *            extended type which is part of some other extended type
      * @param basePackageName
@@ -1109,7 +1101,7 @@ public final class TypeProviderImpl implements TypeProvider {
      * equal depth. In next step are lists from this map concatenated to one
      * list in ascending order according to their depth. All type definitions
      * are in the list behind all type definitions on which depends.
-     * 
+     *
      * @param unsortedTypeDefinitions
      *            list of type definitions which should be sorted by depth
      * @return list of type definitions sorted according their each other
@@ -1142,14 +1134,16 @@ public final class TypeProviderImpl implements TypeProvider {
     /**
      * Returns how many immersion is necessary to get from the type definition
      * to the base type.
-     * 
+     *
      * @param typeDefinition
      *            type definition for which is depth sought.
      * @return number of immersions which are necessary to get from the type
      *         definition to the base type
      */
     private int getTypeDefinitionDepth(final TypeDefinition<?> typeDefinition) {
-        Preconditions.checkArgument(typeDefinition != null, "Type definition can't be null");
+        if (typeDefinition == null) {
+            return 1;
+        }
         int depth = 1;
         TypeDefinition<?> baseType = typeDefinition.getBaseType();
 
@@ -1174,7 +1168,7 @@ public final class TypeProviderImpl implements TypeProvider {
      * Returns string which contains the same value as <code>name</code> but
      * integer suffix is incremented by one. If <code>name</code> contains no
      * number suffix then number 1 is added.
-     * 
+     *
      * @param name
      *            string with name of augmented node
      * @return string with the number suffix incremented by one (or 1 is added)
index bf6f6ae5f010951140ddd34a5ef1e64816aad0f7..61647ddbfa31204a05e1d62e0436f0915df4651e 100644 (file)
@@ -23,7 +23,7 @@ import org.opendaylight.yangtools.yang.model.api.type.RangeConstraint;
  * interface which represents SIGNED Integer values defined in Yang language. <br>
  * The integer built-in types in Yang are int8, int16, int32, int64. They
  * represent signed integers of different sizes:
- * 
+ *
  * <ul>
  * <li>int8 - represents integer values between -128 and 127, inclusively.</li>
  * <li>int16 - represents integer values between -32768 and 32767, inclusively.</li>
@@ -32,9 +32,9 @@ import org.opendaylight.yangtools.yang.model.api.type.RangeConstraint;
  * <li>int64 - represents integer values between -9223372036854775808 and
  * 9223372036854775807, inclusively.</li>
  * </ul>
- * 
+ *
  */
-public abstract class AbstractSignedInteger implements IntegerTypeDefinition {
+abstract class AbstractSignedInteger implements IntegerTypeDefinition {
     private final QName name;
     private final SchemaPath path;
     private final String description;
@@ -61,6 +61,11 @@ public abstract class AbstractSignedInteger implements IntegerTypeDefinition {
                 "https://tools.ietf.org/html/rfc6020#section-9.2.4"));
     }
 
+    @Override
+    public IntegerTypeDefinition getBaseType() {
+        return null;
+    }
+
     @Override
     public String getUnits() {
         return units;
index 04ee7cecd203e7dec3c7f12c99dae6f566bb2cbd..df740b86c11e5d6e2a01fd5844a8adf2da75e6d0 100644 (file)
@@ -19,7 +19,7 @@ import org.opendaylight.yangtools.yang.model.api.type.UnsignedIntegerTypeDefinit
  * interface which represents UNSIGNED Integer values defined in Yang language. <br>
  * The integer built-in types in Yang are uint8, uint16, uint32, and uint64.
  * They represent unsigned integers of different sizes:
- * 
+ *
  * <ul>
  * <li>uint8 - represents integer values between 0 and 255, inclusively.</li>
  * <li>uint16 - represents integer values between 0 and 65535, inclusively.</li>
@@ -28,9 +28,9 @@ import org.opendaylight.yangtools.yang.model.api.type.UnsignedIntegerTypeDefinit
  * <li>uint64 - represents integer values between 0 and 18446744073709551615,
  * inclusively.</li>
  * </ul>
- * 
+ *
  */
-public abstract class AbstractUnsignedInteger implements UnsignedIntegerTypeDefinition {
+abstract class AbstractUnsignedInteger implements UnsignedIntegerTypeDefinition {
     private static final long MIN_VALUE = 0;
     private final QName name;
     private final SchemaPath path;
@@ -40,7 +40,7 @@ public abstract class AbstractUnsignedInteger implements UnsignedIntegerTypeDefi
     private final List<RangeConstraint> rangeStatements;
 
     /**
-     * 
+     *
      * @param name
      * @param description
      * @param maxRange
@@ -57,6 +57,11 @@ public abstract class AbstractUnsignedInteger implements UnsignedIntegerTypeDefi
                 "https://tools.ietf.org/html/rfc6020#section-9.2.4"));
     }
 
+    @Override
+    public UnsignedIntegerTypeDefinition getBaseType() {
+        return null;
+    }
+
     @Override
     public String getUnits() {
         return units;
index d7495ada748068042d4fe9b1d365190168c85abb..fa5c7aa4c539afbf8e47a170d6a4d90d071af99f 100644 (file)
@@ -20,7 +20,7 @@ import org.opendaylight.yangtools.yang.model.api.type.LengthConstraint;
 
 /**
  * The <code>default</code> implementation of Binary Type Definition interface.
- * 
+ *
  * @see BinaryTypeDefinition
  */
 public final class BinaryType implements BinaryTypeDefinition {
@@ -46,18 +46,18 @@ public final class BinaryType implements BinaryTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see
      * org.opendaylight.yangtools.yang.model.api.TypeDefinition#getBaseType()
      */
     @Override
     public BinaryTypeDefinition getBaseType() {
-        return this;
+        return null;
     }
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.opendaylight.yangtools.yang.model.api.TypeDefinition#getUnits()
      */
     @Override
@@ -67,7 +67,7 @@ public final class BinaryType implements BinaryTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see
      * org.opendaylight.yangtools.yang.model.api.TypeDefinition#getDefaultValue
      * ()
@@ -79,7 +79,7 @@ public final class BinaryType implements BinaryTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getQName()
      */
     @Override
@@ -89,7 +89,7 @@ public final class BinaryType implements BinaryTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getPath()
      */
     @Override
@@ -99,7 +99,7 @@ public final class BinaryType implements BinaryTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see
      * org.opendaylight.yangtools.yang.model.api.SchemaNode#getDescription()
      */
@@ -110,7 +110,7 @@ public final class BinaryType implements BinaryTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getReference()
      */
     @Override
@@ -120,7 +120,7 @@ public final class BinaryType implements BinaryTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getStatus()
      */
     @Override
@@ -130,7 +130,7 @@ public final class BinaryType implements BinaryTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see
      * org.opendaylight.yangtools.yang.model.base.type.api.BinaryTypeDefinition
      * #getLengthConstraint ()
index cacfeb305ded07c22c5582878263877fdf9af428..c53df1bc6aa71259f030a996bc4259f2d8378518 100644 (file)
@@ -18,7 +18,7 @@ import org.opendaylight.yangtools.yang.model.api.type.BitsTypeDefinition;
 
 /**
  * The <code>default</code> implementation of Bits Type Definition interface.
- * 
+ *
  * @see BitsTypeDefinition
  */
 public final class BitsType implements BitsTypeDefinition {
@@ -29,26 +29,24 @@ public final class BitsType implements BitsTypeDefinition {
             + "numbers starting at 0.  Each bit number has an assigned name.";
 
     private static final String REFERENCE = "https://tools.ietf.org/html/rfc6020#section-9.7";
-    private final BitsTypeDefinition baseType;
     private final List<Bit> bits;
     private static final String UNITS = "";
 
     /**
      * Default constructor. <br>
      * Instantiates Bits type as empty bits list.
-     * 
+     *
      * @param path
      */
     public BitsType(final SchemaPath path) {
         super();
         this.bits = Collections.emptyList();
         this.path = path;
-        this.baseType = this;
     }
 
     /**
      * Constructor with explicit definition of bits assigned to BitsType.
-     * 
+     *
      * @param path
      * @param bits
      */
@@ -56,23 +54,22 @@ public final class BitsType implements BitsTypeDefinition {
         super();
         this.bits = Collections.unmodifiableList(bits);
         this.path = path;
-        this.baseType = this;
     }
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see
      * org.opendaylight.yangtools.yang.model.api.TypeDefinition#getBaseType()
      */
     @Override
     public BitsTypeDefinition getBaseType() {
-        return baseType;
+        return null;
     }
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.opendaylight.yangtools.yang.model.api.TypeDefinition#getUnits()
      */
     @Override
@@ -82,7 +79,7 @@ public final class BitsType implements BitsTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see
      * org.opendaylight.yangtools.yang.model.api.TypeDefinition#getDefaultValue
      * ()
@@ -94,7 +91,7 @@ public final class BitsType implements BitsTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getQName()
      */
     @Override
@@ -104,7 +101,7 @@ public final class BitsType implements BitsTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getPath()
      */
     @Override
@@ -114,7 +111,7 @@ public final class BitsType implements BitsTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see
      * org.opendaylight.yangtools.yang.model.api.SchemaNode#getDescription()
      */
@@ -125,7 +122,7 @@ public final class BitsType implements BitsTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getReference()
      */
     @Override
@@ -135,7 +132,7 @@ public final class BitsType implements BitsTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getStatus()
      */
     @Override
index 9d7aff3366d5dcf62ffb4d79b4bcb4bca4d6c8a5..b4740884fb24743a4c3b3b5f6522da9d81a580de 100644 (file)
@@ -18,7 +18,7 @@ import org.opendaylight.yangtools.yang.model.api.type.BooleanTypeDefinition;
 
 /**
  * The <code>default</code> implementation of Boolean Type Definition interface.
- * 
+ *
  * @see BooleanTypeDefinition
  */
 public final class BooleanType implements BooleanTypeDefinition {
@@ -41,18 +41,18 @@ public final class BooleanType implements BooleanTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see
      * org.opendaylight.yangtools.yang.model.api.TypeDefinition#getBaseType()
      */
     @Override
     public BooleanTypeDefinition getBaseType() {
-        return this;
+        return null;
     }
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.opendaylight.yangtools.yang.model.api.TypeDefinition#getUnits()
      */
     @Override
@@ -62,7 +62,7 @@ public final class BooleanType implements BooleanTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see
      * org.opendaylight.yangtools.yang.model.api.TypeDefinition#getDefaultValue
      * ()
@@ -74,7 +74,7 @@ public final class BooleanType implements BooleanTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getQName()
      */
     @Override
@@ -84,7 +84,7 @@ public final class BooleanType implements BooleanTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getPath()
      */
     @Override
@@ -94,7 +94,7 @@ public final class BooleanType implements BooleanTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see
      * org.opendaylight.yangtools.yang.model.api.SchemaNode#getDescription()
      */
@@ -105,7 +105,7 @@ public final class BooleanType implements BooleanTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getReference()
      */
     @Override
@@ -115,7 +115,7 @@ public final class BooleanType implements BooleanTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getStatus()
      */
     @Override
index 5242e40f2f3e7c4f01aafadf59d6c51d059b5100..666747915f3444becdf2e372b9fc9c15b6da1ab3 100644 (file)
@@ -21,8 +21,8 @@ import org.opendaylight.yangtools.yang.model.api.type.RangeConstraint;
 
 /**
  * The <code>default</code> implementation of Decimal Type Definition interface.
- * 
- * 
+ *
+ *
  * @see DecimalTypeDefinition
  */
 public final class Decimal64 implements DecimalTypeDefinition {
@@ -40,7 +40,6 @@ public final class Decimal64 implements DecimalTypeDefinition {
 
     private final List<RangeConstraint> rangeStatements;
     private final Integer fractionDigits;
-    private final DecimalTypeDefinition baseType;
     private static final int MAX_NUMBER_OF_FRACTION_DIGITS = 18;
 
     /**
@@ -54,11 +53,11 @@ public final class Decimal64 implements DecimalTypeDefinition {
      * {@link DecimalTypeDefinition} <br>
      * If the fraction digits are not defined inner the definition boundaries
      * the constructor will throw {@link IllegalArgumentException}
-     * 
+     *
      * @param path
      * @param fractionDigits
      *            integer between 1 and 18 inclusively
-     * 
+     *
      * @see DecimalTypeDefinition
      * @exception IllegalArgumentException
      */
@@ -70,12 +69,11 @@ public final class Decimal64 implements DecimalTypeDefinition {
         this.fractionDigits = fractionDigits;
         rangeStatements = defaultRangeStatements();
         this.path = path;
-        this.baseType = this;
     }
 
     /**
      * Returns unmodifiable List with default definition of Range Statements.
-     * 
+     *
      * @return unmodifiable List with default definition of Range Statements.
      */
     private List<RangeConstraint> defaultRangeStatements() {
@@ -90,7 +88,7 @@ public final class Decimal64 implements DecimalTypeDefinition {
 
     @Override
     public DecimalTypeDefinition getBaseType() {
-        return baseType;
+        return null;
     }
 
     @Override
index ee56f760d49b7dff67bd4ba00ad81e7209be4d84..c4f78c621da82d23f7177d79d4a344cdfa18926c 100644 (file)
@@ -35,7 +35,7 @@ public final class EmptyType implements EmptyTypeDefinition {
 
     @Override
     public EmptyTypeDefinition getBaseType() {
-        return this;
+        return null;
     }
 
     @Override
index 3ae8eb346de99e78e63fceb7469ab3912917e07a..ea0e9f3fe1e250c1682f3b3b2e7b87db10fc9101 100644 (file)
@@ -19,7 +19,7 @@ import org.opendaylight.yangtools.yang.model.api.type.EnumTypeDefinition;
 /**
  * The <code>default</code> implementation of Enumertaion Type Definition
  * interface.
- * 
+ *
  * @see EnumTypeDefinition
  */
 public final class EnumerationType implements EnumTypeDefinition {
@@ -31,38 +31,35 @@ public final class EnumerationType implements EnumTypeDefinition {
     private final EnumPair defaultEnum;
     private final List<EnumPair> enums;
     private static final String UNITS = "";
-    private final EnumTypeDefinition baseType;
 
     public EnumerationType(final SchemaPath path, final List<EnumPair> enums) {
         super();
         this.path = path;
         this.enums = Collections.unmodifiableList(enums);
         this.defaultEnum = null;
-        this.baseType = this;
     }
 
     public EnumerationType(final SchemaPath path, final EnumPair defaultEnum, final List<EnumPair> enums) {
         super();
         this.path = path;
-        this.baseType = this;
         this.defaultEnum = defaultEnum;
         this.enums = Collections.unmodifiableList(enums);
     }
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see
      * org.opendaylight.yangtools.yang.model.api.TypeDefinition#getBaseType()
      */
     @Override
     public EnumTypeDefinition getBaseType() {
-        return baseType;
+        return null;
     }
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.opendaylight.yangtools.yang.model.api.TypeDefinition#getUnits()
      */
     @Override
@@ -72,7 +69,7 @@ public final class EnumerationType implements EnumTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see
      * org.opendaylight.yangtools.yang.model.api.TypeDefinition#getDefaultValue
      * ()
@@ -84,7 +81,7 @@ public final class EnumerationType implements EnumTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getQName()
      */
     @Override
@@ -94,7 +91,7 @@ public final class EnumerationType implements EnumTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getPath()
      */
     @Override
@@ -104,7 +101,7 @@ public final class EnumerationType implements EnumTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see
      * org.opendaylight.yangtools.yang.model.api.SchemaNode#getDescription()
      */
@@ -115,7 +112,7 @@ public final class EnumerationType implements EnumTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getReference()
      */
     @Override
@@ -125,7 +122,7 @@ public final class EnumerationType implements EnumTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getStatus()
      */
     @Override
@@ -135,7 +132,7 @@ public final class EnumerationType implements EnumTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see
      * org.opendaylight.yangtools.yang.model.base.type.api.EnumTypeDefinition
      * #getValues()
index 1156762cca83c9a1a583dcaf1e2acd6b5352c0a4..d7ba3dc771d5143c5536ae987acdf313e0a35664 100644 (file)
@@ -19,7 +19,7 @@ import org.opendaylight.yangtools.yang.model.api.type.IdentityrefTypeDefinition;
 /**
  * The <code>default</code> implementation of Identityref Type Definition
  * interface.
- * 
+ *
  * @see IdentityrefTypeDefinition
  */
 public final class IdentityrefType implements IdentityrefTypeDefinition {
@@ -27,14 +27,12 @@ public final class IdentityrefType implements IdentityrefTypeDefinition {
     private final SchemaPath path;
     private static final String DESCRIPTION = "The identityref type is used to reference an existing identity.";
     private static final String REFERENCE = "https://tools.ietf.org/html/rfc6020#section-9.10";
-    private final IdentityrefTypeDefinition baseType;
     private final QName identity;
     private static final String UNITS = "";
 
     public IdentityrefType(QName identity, SchemaPath schemaPath) {
         this.identity = identity;
         this.path = schemaPath;
-        this.baseType = this;
     }
 
     @Override
@@ -84,7 +82,7 @@ public final class IdentityrefType implements IdentityrefTypeDefinition {
 
     @Override
     public IdentityrefTypeDefinition getBaseType() {
-        return baseType;
+        return null;
     }
 
     @Override
index 4949d4ebeec24721bf6693b52e14e61b2699ea00..aae5b8ee1f52c32a6defc2dec33b2f25615370fd 100644 (file)
@@ -20,7 +20,7 @@ import org.opendaylight.yangtools.yang.model.api.type.InstanceIdentifierTypeDefi
 /**
  * The <code>default</code> implementation of Instance Identifier Type
  * Definition interface.
- * 
+ *
  * @see InstanceIdentifierTypeDefinition
  */
 public final class InstanceIdentifier implements InstanceIdentifierTypeDefinition {
@@ -48,18 +48,18 @@ public final class InstanceIdentifier implements InstanceIdentifierTypeDefinitio
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see
      * org.opendaylight.yangtools.yang.model.api.TypeDefinition#getBaseType()
      */
     @Override
     public InstanceIdentifierTypeDefinition getBaseType() {
-        return this;
+        return null;
     }
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.opendaylight.yangtools.yang.model.api.TypeDefinition#getUnits()
      */
     @Override
@@ -69,7 +69,7 @@ public final class InstanceIdentifier implements InstanceIdentifierTypeDefinitio
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see
      * org.opendaylight.yangtools.yang.model.api.TypeDefinition#getDefaultValue
      * ()
@@ -81,7 +81,7 @@ public final class InstanceIdentifier implements InstanceIdentifierTypeDefinitio
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getQName()
      */
     @Override
@@ -91,7 +91,7 @@ public final class InstanceIdentifier implements InstanceIdentifierTypeDefinitio
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getPath()
      */
     @Override
@@ -101,7 +101,7 @@ public final class InstanceIdentifier implements InstanceIdentifierTypeDefinitio
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see
      * org.opendaylight.yangtools.yang.model.api.SchemaNode#getDescription()
      */
@@ -112,7 +112,7 @@ public final class InstanceIdentifier implements InstanceIdentifierTypeDefinitio
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getReference()
      */
     @Override
@@ -122,7 +122,7 @@ public final class InstanceIdentifier implements InstanceIdentifierTypeDefinitio
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getStatus()
      */
     @Override
@@ -132,7 +132,7 @@ public final class InstanceIdentifier implements InstanceIdentifierTypeDefinitio
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see
      * org.opendaylight.yangtools.yang.model.api.SchemaNode#getExtensionSchemaNodes
      * ()
@@ -144,7 +144,7 @@ public final class InstanceIdentifier implements InstanceIdentifierTypeDefinitio
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.opendaylight.yangtools.yang.model.api.type.
      * InstanceIdentifierTypeDefinition# getPathStatement()
      */
@@ -155,7 +155,7 @@ public final class InstanceIdentifier implements InstanceIdentifierTypeDefinitio
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.opendaylight.yangtools.yang.model.api.type.
      * InstanceIdentifierTypeDefinition# requireInstance()
      */
index d73bf754ff459f84fdbb1ce7f89c46f321aa14ae..63caa24500d6e285a685d80bc1a64ebcb992cfdb 100644 (file)
@@ -8,13 +8,12 @@
 package org.opendaylight.yangtools.yang.model.util;
 
 import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.model.api.type.IntegerTypeDefinition;
 
 /**
  * Implementation of Yang int16 built-in type. <br>
  * int16 represents integer values between -32768 and 32767, inclusively. The
  * Java counterpart of Yang int16 built-in type is {@link Short}.
- * 
+ *
  * @see AbstractSignedInteger
  */
 public final class Int16 extends AbstractSignedInteger {
@@ -33,11 +32,6 @@ public final class Int16 extends AbstractSignedInteger {
         return instance;
     }
 
-    @Override
-    public IntegerTypeDefinition getBaseType() {
-        return this;
-    }
-
     @Override
     public Object getDefaultValue() {
         return null;
index 799ca00d0c39f3439f3ab1309696fa8f9bbe2d75..b043d40a7ed7b443557e6a34fc3ccd379db0d1bb 100644 (file)
@@ -8,16 +8,15 @@
 package org.opendaylight.yangtools.yang.model.util;
 
 import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.model.api.type.IntegerTypeDefinition;
 
 /**
  * Implementation of Yang int32 built-in type. <br>
  * int32 represents integer values between -2147483648 and 2147483647,
  * inclusively. The Java counterpart of Yang int32 built-in type is
  * {@link Integer}.
- * 
+ *
  * @see AbstractSignedInteger
- * 
+ *
  */
 public final class Int32 extends AbstractSignedInteger {
     private static Int32 instance;
@@ -35,11 +34,6 @@ public final class Int32 extends AbstractSignedInteger {
         return instance;
     }
 
-    @Override
-    public IntegerTypeDefinition getBaseType() {
-        return this;
-    }
-
     @Override
     public Object getDefaultValue() {
         return null;
index a22d2d5a6c478a75cfc33996381c80e7fa9b03cd..5f4202254786df35c1a3c22609bdf50c7e78eb17 100644 (file)
@@ -8,14 +8,13 @@
 package org.opendaylight.yangtools.yang.model.util;
 
 import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.model.api.type.IntegerTypeDefinition;
 
 /**
  * Implementation of Yang int64 built-in type. <br>
  * int64 represents integer values between -9223372036854775808 and
  * 9223372036854775807, inclusively. The Java counterpart of Yang int64 built-in
  * type is {@link Long}.
- * 
+ *
  */
 public final class Int64 extends AbstractSignedInteger {
     private static Int64 instance;
@@ -33,11 +32,6 @@ public final class Int64 extends AbstractSignedInteger {
         return instance;
     }
 
-    @Override
-    public IntegerTypeDefinition getBaseType() {
-        return this;
-    }
-
     @Override
     public Object getDefaultValue() {
         return null;
index 16f7ee68f52cdea2246092f88f32572dc50fd977..5df2db696f39a1391fd71441016c93dde6d6df0e 100644 (file)
@@ -8,13 +8,12 @@
 package org.opendaylight.yangtools.yang.model.util;
 
 import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.model.api.type.IntegerTypeDefinition;
 
 /**
  * Implementation of Yang int8 built-in type. <br>
  * int8 represents integer values between -128 and 127, inclusively. The Java
  * counterpart of Yang int8 built-in type is {@link Byte}.
- * 
+ *
  * @see AbstractSignedInteger
  */
 public final class Int8 extends AbstractSignedInteger {
@@ -33,11 +32,6 @@ public final class Int8 extends AbstractSignedInteger {
         return instance;
     }
 
-    @Override
-    public IntegerTypeDefinition getBaseType() {
-        return this;
-    }
-
     @Override
     public Object getDefaultValue() {
         return null;
index f5a9bbf5595d1b2cffc2e83167aae4c3fdaaf57b..8ef325cfdf3bbc9aba90840b8b404d2c4bcdb0d9 100644 (file)
@@ -37,7 +37,7 @@ public final class Leafref implements LeafrefTypeDefinition {
 
     @Override
     public LeafrefTypeDefinition getBaseType() {
-        return this;
+        return null;
     }
 
     @Override
index 727229bdaeda52c46189df7873986abfd15900f3..905278357eeec5ad191d912c2639d91d27189a33 100644 (file)
@@ -21,7 +21,7 @@ import org.opendaylight.yangtools.yang.model.api.type.StringTypeDefinition;
 
 /**
  * The <code>default</code> implementation of String Type Definition interface.
- * 
+ *
  * @see StringTypeDefinition
  */
 public final class StringType implements StringTypeDefinition {
@@ -51,18 +51,18 @@ public final class StringType implements StringTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see
      * org.opendaylight.yangtools.yang.model.api.TypeDefinition#getBaseType()
      */
     @Override
     public StringTypeDefinition getBaseType() {
-        return this;
+        return null;
     }
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.opendaylight.yangtools.yang.model.api.TypeDefinition#getUnits()
      */
     @Override
@@ -72,7 +72,7 @@ public final class StringType implements StringTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see
      * org.opendaylight.yangtools.yang.model.api.TypeDefinition#getDefaultValue
      * ()
@@ -84,7 +84,7 @@ public final class StringType implements StringTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getQName()
      */
     @Override
@@ -94,7 +94,7 @@ public final class StringType implements StringTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getPath()
      */
     @Override
@@ -104,7 +104,7 @@ public final class StringType implements StringTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see
      * org.opendaylight.yangtools.yang.model.api.SchemaNode#getDescription()
      */
@@ -115,7 +115,7 @@ public final class StringType implements StringTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getReference()
      */
     @Override
@@ -125,7 +125,7 @@ public final class StringType implements StringTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getStatus()
      */
     @Override
@@ -135,7 +135,7 @@ public final class StringType implements StringTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see
      * com.csico.yang.model.base.type.api.StringTypeDefinition#getLengthStatements
      * ()
@@ -147,7 +147,7 @@ public final class StringType implements StringTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see
      * com.csico.yang.model.base.type.api.StringTypeDefinition#getPatterns()
      */
index 120f4926cf875b6c0c90f398711d594dea810142..4c386c48d5b3988f083bb794f2840e745158746f 100644 (file)
@@ -8,13 +8,12 @@
 package org.opendaylight.yangtools.yang.model.util;
 
 import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.model.api.type.UnsignedIntegerTypeDefinition;
 
 /**
  * Implementation of Yang uint16 built-in type. <br>
  * uint16 represents integer values between 0 and 65535, inclusively. The Java
  * counterpart of Yang uint16 built-in type is {@link Integer}.
- * 
+ *
  */
 public final class Uint16 extends AbstractUnsignedInteger {
     public static final int MAX_VALUE = 65535;
@@ -33,11 +32,6 @@ public final class Uint16 extends AbstractUnsignedInteger {
         return instance;
     }
 
-    @Override
-    public UnsignedIntegerTypeDefinition getBaseType() {
-        return this;
-    }
-
     @Override
     public Object getDefaultValue() {
         return null;
index 375a26bf918aa6c909480d1fb85f048ac21b93bc..dd3183d51bf028fdc605e3381f28fe7920224122 100644 (file)
@@ -8,12 +8,11 @@
 package org.opendaylight.yangtools.yang.model.util;
 
 import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.model.api.type.UnsignedIntegerTypeDefinition;
 
 /**
  * Implementation of Yang uint32 built-in type. <br>
  * uint32 represents integer values between 0 and 4294967295, inclusively.
- * 
+ *
  */
 public final class Uint32 extends AbstractUnsignedInteger {
     public static final long MAX_VALUE = 4294967295L;
@@ -32,11 +31,6 @@ public final class Uint32 extends AbstractUnsignedInteger {
         return instance;
     }
 
-    @Override
-    public UnsignedIntegerTypeDefinition getBaseType() {
-        return this;
-    }
-
     @Override
     public Object getDefaultValue() {
         return null;
index e003873eb6641bd2e212b14b76907e42ea78cafc..555b76f5feb96ac74a99ee4d285a5edb707b9bae 100644 (file)
@@ -10,14 +10,13 @@ package org.opendaylight.yangtools.yang.model.util;
 import java.math.BigInteger;
 
 import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.model.api.type.UnsignedIntegerTypeDefinition;
 
 /**
  * Implementation of Yang uint64 built-in type. <br>
  * uint64 represents integer values between 0 and 18446744073709551615,
  * inclusively. The Java counterpart of Yang uint64 built-in type is
  * {@link BigInteger}.
- * 
+ *
  */
 public final class Uint64 extends AbstractUnsignedInteger {
     public static final BigInteger MAX_VALUE = new BigInteger("18446744073709551615");
@@ -36,11 +35,6 @@ public final class Uint64 extends AbstractUnsignedInteger {
         return instance;
     }
 
-    @Override
-    public UnsignedIntegerTypeDefinition getBaseType() {
-        return this;
-    }
-
     @Override
     public Object getDefaultValue() {
         return null;
index 4c36ae1d906c7cfbe33065103bb56562c6b52a5d..2212585f0238e69746df6a75f79b2e86424077cd 100644 (file)
@@ -8,12 +8,11 @@
 package org.opendaylight.yangtools.yang.model.util;
 
 import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.model.api.type.UnsignedIntegerTypeDefinition;
 
 /**
  * Implementation of Yang uint8 built-in type. <br>
  * uint8 represents integer values between 0 and 255, inclusively.
- * 
+ *
  * @see AbstractUnsignedInteger
  */
 public final class Uint8 extends AbstractUnsignedInteger {
@@ -33,11 +32,6 @@ public final class Uint8 extends AbstractUnsignedInteger {
         return instance;
     }
 
-    @Override
-    public UnsignedIntegerTypeDefinition getBaseType() {
-        return this;
-    }
-
     @Override
     public Object getDefaultValue() {
         return null;
index a12c1c1119ab0520843279d8e61617dbe0196cef..99390b09803a438152bba18f0cee6ceaf8e196b5 100644 (file)
@@ -33,7 +33,7 @@ public final class UnionType implements UnionTypeDefinition {
 
     @Override
     public UnionTypeDefinition getBaseType() {
-        return this;
+        return null;
     }
 
     @Override
index aab41b8534bc6592af91fd0fb442193185c98001..2fc4bea95ea37766dd4a48b7bd5e643a184ff119 100644 (file)
@@ -1,6 +1,7 @@
 package org.opendaylight.yangtools.yang.model.util;
 
 import static org.junit.Assert.*;
+
 import org.junit.Test;
 
 public class Int8Test {
@@ -10,7 +11,7 @@ public class Int8Test {
         Int8 int8 = Int8.getInstance();
         Int8 int8Second = Int8.getInstance();
         assertTrue("The method 'getInstance()' has to return the same instance", int8 == int8Second);
-        assertTrue("The method 'getBaseType()' is returning incorrect value", int8.getBaseType() == int8);
+        assertTrue("The method 'getBaseType()' is returning incorrect value", int8.getBaseType() == null);
         assertTrue("The method 'getDefaultType()' is returning incorrect value", int8.getDefaultValue() == null);
         assertEquals("The method 'toString()' is returning incorrect value",
                 "type (urn:ietf:params:xml:ns:yang:1)int8", int8.toString());