Share Object Type 55/73155/1
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 18 Jun 2018 19:58:44 +0000 (21:58 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 18 Jun 2018 20:05:26 +0000 (22:05 +0200)
Add a constant and an accessor for java.lang.Object ConcreteType.

Change-Id: Idb6f120d75c401398d7e1c2cb5d923727d61040a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
binding/mdsal-binding-generator-impl/src/main/java/org/opendaylight/mdsal/binding/yang/types/AbstractTypeProvider.java
binding/mdsal-binding-generator-util/src/main/java/org/opendaylight/mdsal/binding/model/util/Types.java

index d0dbc593e875ae7f224aa2095cb24bccdcce055e..2854f65639a025508a304e8bc5184c513498ddf3 100644 (file)
@@ -558,7 +558,7 @@ public abstract class AbstractTypeProvider implements TypeProvider {
                     returnType = resolveTypeFromDataSchemaNode(dataNode);
                 }
             } else {
-                returnType = Types.typeForClass(Object.class);
+                returnType = Types.objectType();
             }
         }
         Preconditions.checkArgument(returnType != null, "Failed to find leafref target: %s in module %s (%s)",
index 4d8edcf1846c8a5398c59e2d27de6952bf391a00..697a8952121e83cd91eb62bd370432f76b959dd7 100644 (file)
@@ -57,6 +57,7 @@ public final class Types {
     public static final ConcreteType BYTE_ARRAY = typeForClass(byte[].class);
     public static final ConcreteType CHAR_ARRAY = typeForClass(char[].class);
 
+    private static final ConcreteType OBJECT = typeForClass(Object.class);
     private static final ConcreteType PRIMITIVE_VOID = typeForClass(void.class);
     private static final ConcreteType SERIALIZABLE = typeForClass(Serializable.class);
 
@@ -75,6 +76,15 @@ public final class Types {
         return VOID;
     }
 
+    /**
+     * Returns an instance of {@link ConcreteType} which represents {@link Object} type.
+     *
+     * @return <code>ConcreteType</code> instance which represents {@link Object}
+     */
+    public static ConcreteType objectType() {
+        return OBJECT;
+    }
+
     /**
      * Returns an instance of {@link ConcreteType} which represents JAVA <code>void</code> type.
      *