Remove BaseTypes.isInt8() and friends 58/92858/1
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 2 Oct 2020 14:24:40 +0000 (16:24 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Fri, 2 Oct 2020 14:25:33 +0000 (16:25 +0200)
These methods are only used in mdsal's binding generator, remove
them for rehosting.

JIRA: YANGTOOLS-1099
Change-Id: Ic80f9f3aa99d82ba0ad19fc5e9275032e1f46f84
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/type/BaseTypes.java
yang/yang-model-util/src/test/java/org/opendaylight/yangtools/yang/model/util/type/TypeTest.java

index 9e752cbac65dfe2b20f07f7c48e7a82cc654309a..7960f2e7aa6afcb608d23c9bff697152a9391639 100644 (file)
@@ -95,59 +95,18 @@ public final class BaseTypes {
         return BaseInt8Type.INSTANCE;
     }
 
-    /**
-     * Check if a particular type definition represents the built-in int8 type.
-     *
-     * @param type Type definition
-     * @return True if the definition is the built-in int8 type.
-     */
-    public static boolean isInt8(final TypeDefinition<?> type) {
-        return BaseInt8Type.INSTANCE.getPath().equals(type.getPath());
-    }
-
     public static @NonNull Int16TypeDefinition int16Type() {
         return BaseInt16Type.INSTANCE;
     }
 
-    /**
-     * Check if a particular type definition represents the built-in int16 type.
-     *
-     * @param type Type definition
-     * @return True if the definition is the built-in int16 type.
-     */
-    public static boolean isInt16(final TypeDefinition<?> type) {
-        return BaseInt16Type.INSTANCE.getPath().equals(type.getPath());
-    }
-
     public static @NonNull Int32TypeDefinition int32Type() {
         return BaseInt32Type.INSTANCE;
     }
 
-    /**
-     * Check if a particular type definition represents the built-in int32 type.
-     *
-     * @param type Type definition
-     * @return True if the definition is the built-in int32 type.
-     */
-
-    public static boolean isInt32(final TypeDefinition<?> type) {
-        return BaseInt32Type.INSTANCE.getPath().equals(type.getPath());
-    }
-
     public static @NonNull Int64TypeDefinition int64Type() {
         return BaseInt64Type.INSTANCE;
     }
 
-    /**
-     * Check if a particular type definition represents the built-in int64 type.
-     *
-     * @param type Type definition
-     * @return True if the definition is the built-in int64 type.
-     */
-    public static boolean isInt64(final TypeDefinition<?> type) {
-        return BaseInt64Type.INSTANCE.getPath().equals(type.getPath());
-    }
-
     public static @NonNull LeafrefTypeBuilder leafrefTypeBuilder(final SchemaPath path) {
         return new LeafrefTypeBuilder(path);
     }
@@ -164,62 +123,18 @@ public final class BaseTypes {
         return BaseUint8Type.INSTANCE;
     }
 
-    /**
-     * Check if a particular type is the base type for uint8.
-     *
-     * @param type The type to check
-     * @return If the type corresponds to the base uint8 type.
-     * @throws NullPointerException if type is null
-     */
-    public static boolean isUint8(final @NonNull TypeDefinition<?> type) {
-        return BaseUint8Type.INSTANCE.getPath().equals(type.getPath());
-    }
-
     public static @NonNull Uint16TypeDefinition uint16Type() {
         return BaseUint16Type.INSTANCE;
     }
 
-    /**
-     * Check if a particular type is the base type for uint16.
-     *
-     * @param type The type to check
-     * @return If the type corresponds to the base uint16 type.
-     * @throws NullPointerException if type is null
-     */
-    public static boolean isUint16(final @NonNull TypeDefinition<?> type) {
-        return BaseUint16Type.INSTANCE.getPath().equals(type.getPath());
-    }
-
     public static @NonNull Uint32TypeDefinition uint32Type() {
         return BaseUint32Type.INSTANCE;
     }
 
-    /**
-     * Check if a particular type is the base type for uint32.
-     *
-     * @param type The type to check
-     * @return If the type corresponds to the base uint32 type.
-     * @throws NullPointerException if type is null
-     */
-    public static boolean isUint32(final @NonNull TypeDefinition<?> type) {
-        return BaseUint32Type.INSTANCE.getPath().equals(type.getPath());
-    }
-
     public static @NonNull Uint64TypeDefinition uint64Type() {
         return BaseUint64Type.INSTANCE;
     }
 
-    /**
-     * Check if a particular type is the base type for uint64.
-     *
-     * @param type The type to check
-     * @return If the type corresponds to the base uint64 type.
-     * @throws NullPointerException if type is null
-     */
-    public static boolean isUint64(final @NonNull TypeDefinition<?> type) {
-        return BaseUint64Type.INSTANCE.getPath().equals(type.getPath());
-    }
-
     /**
      * Return the base type of a particular type. This method performs recursive lookup through the type's base type
      * until it finds the last element and returns it. If the argument is already the base type, it is returned as is.
index 09daa177c9cef4fa2786be17479519be974e54d3..3fdb3e4e86ed20d03abe8aa364d79061030f6558 100644 (file)
@@ -206,10 +206,6 @@ public class TypeTest {
         final Int16TypeDefinition integerTypeDefinition16 = BaseTypes.int16Type();
         final Int32TypeDefinition integerTypeDefinition32 = BaseTypes.int32Type();
         final Int64TypeDefinition integerTypeDefinition64 = BaseTypes.int64Type();
-        assertTrue(BaseTypes.isInt8(integerTypeDefinition8));
-        assertTrue(BaseTypes.isInt16(integerTypeDefinition16));
-        assertTrue(BaseTypes.isInt32(integerTypeDefinition32));
-        assertTrue(BaseTypes.isInt64(integerTypeDefinition64));
         testInstance(BaseInt8Type.INSTANCE, integerTypeDefinition8);
         testInstance(BaseInt16Type.INSTANCE, integerTypeDefinition16);
         testInstance(BaseInt32Type.INSTANCE, integerTypeDefinition32);
@@ -225,10 +221,6 @@ public class TypeTest {
         final Uint16TypeDefinition integerTypeDefinitionu16 = BaseTypes.uint16Type();
         final Uint32TypeDefinition integerTypeDefinitionu32 = BaseTypes.uint32Type();
         final Uint64TypeDefinition integerTypeDefinitionu64 = BaseTypes.uint64Type();
-        assertTrue(BaseTypes.isUint8(integerTypeDefinitionu8));
-        assertTrue(BaseTypes.isUint16(integerTypeDefinitionu16));
-        assertTrue(BaseTypes.isUint32(integerTypeDefinitionu32));
-        assertTrue(BaseTypes.isUint64(integerTypeDefinitionu64));
         testInstance(BaseUint8Type.INSTANCE, integerTypeDefinitionu8);
         testInstance(BaseUint16Type.INSTANCE, integerTypeDefinitionu16);
         testInstance(BaseUint32Type.INSTANCE, integerTypeDefinitionu32);