Bug 1411-5 #1: MDSAL Binding2 Generator Util 86/46886/4
authorFilip Gregor <fgregor@cisco.com>
Thu, 13 Oct 2016 13:24:40 +0000 (15:24 +0200)
committerFilip Gregor <fgregor@cisco.com>
Fri, 14 Oct 2016 11:41:58 +0000 (11:41 +0000)
new constant definitions
change of variable initialization order
fixed equals method

Change-Id: I41f7cacc2e7e21f0ac69b7e8a0b682addc83b5b9
Signed-off-by: Filip Gregor <fgregor@cisco.com>
binding2/mdsal-binding2-generator-util/src/main/java/org/opendaylight/mdsal/binding2/generator/util/AbstractBaseType.java
binding2/mdsal-binding2-generator-util/src/main/java/org/opendaylight/mdsal/binding2/generator/util/Binding2Mapping.java
binding2/mdsal-binding2-generator-util/src/main/java/org/opendaylight/mdsal/binding2/generator/util/Types.java

index 3e0c205fba67988bce5b49f72acafa4cca3e2245..a1c13e28e8dfb65971a45a253330495a09d96250 100644 (file)
@@ -57,11 +57,11 @@ abstract public class AbstractBaseType implements Type {
         if (obj == null) {
             return false;
         }
-        if (getClass() != obj.getClass()) {
+        if (!(obj instanceof Type)) {
             return false;
         }
         Type other = (Type) obj;
-        return Objects.equals(this, other);
+        return Objects.equals(name, other.getName()) && Objects.equals(packageName, other.getPackageName());
     }
 
 
index 1013421bb2dcc3e36279fee144ba8131dae32598..8c69e788fc9e403db96092b706eff19c80f25bbd 100644 (file)
@@ -49,6 +49,10 @@ public final class Binding2Mapping {
             .omitEmptyStrings().trimResults();
     private static final Pattern COLON_SLASH_SLASH = Pattern.compile("://", Pattern.LITERAL);
     private static final String QUOTED_DOT = Matcher.quoteReplacement(".");
+    public static final String MODULE_INFO_CLASS_NAME = "$YangModuleInfoImpl";
+    public static final String MODEL_BINDING_PROVIDER_CLASS_NAME = "$YangModelBindingProvider";
+    public static final String PATTERN_CONSTANT_NAME = "PATTERN_CONSTANTS";
+    public static final String MEMBER_PATTERN_LIST = "patterns";
 
     private static final ThreadLocal<SimpleDateFormat> PACKAGE_DATE_FORMAT = new ThreadLocal<SimpleDateFormat>() {
 
index 014992661a8fe2aed171111699febf3e07bed50d..57976ce1b1110b7a2dcb4c9be97ac113956be335 100644 (file)
@@ -39,19 +39,6 @@ import org.opendaylight.yangtools.yang.model.util.BaseConstraints;
 
 @Beta
 public final class Types {
-
-    public static final ConcreteType BOOLEAN = typeForClass(Boolean.class);
-    public static final ConcreteType RPC_CALLBACK = typeForClass(RpcCallback.class);
-    public static final ConcreteType STRING = typeForClass(String.class);
-    public static final ConcreteType VOID = typeForClass(Void.class);
-    public static final ConcreteType BYTE_ARRAY = primitiveType("byte[]", null);
-    public static final ConcreteType CHAR_ARRAY = primitiveType("char[]", null);
-
-    private static final Splitter DOT_SPLITTER = Splitter.on('.');
-    private static final Type SET_TYPE = typeForClass(Set.class);
-    private static final Type LIST_TYPE = typeForClass(List.class);
-    private static final Type MAP_TYPE = typeForClass(Map.class);
-
     private static final CacheLoader<Class<?>, ConcreteType> TYPE_LOADER =
             new CacheLoader<Class<?>, ConcreteType>() {
 
@@ -64,6 +51,17 @@ public final class Types {
     private static final LoadingCache<Class<?>, ConcreteType> TYPE_CACHE =
             CacheBuilder.newBuilder().weakKeys().build(TYPE_LOADER);
 
+    public static final ConcreteType BOOLEAN = typeForClass(Boolean.class);
+    public static final ConcreteType RPC_CALLBACK = typeForClass(RpcCallback.class);
+    public static final ConcreteType STRING = typeForClass(String.class);
+    public static final ConcreteType VOID = typeForClass(Void.class);
+    public static final ConcreteType BYTE_ARRAY = primitiveType("byte[]", null);
+    public static final ConcreteType CHAR_ARRAY = primitiveType("char[]", null);
+
+    private static final Splitter DOT_SPLITTER = Splitter.on('.');
+    private static final Type SET_TYPE = typeForClass(Set.class);
+    private static final Type LIST_TYPE = typeForClass(List.class);
+    private static final Type MAP_TYPE = typeForClass(Map.class);
 
     private Types() {
         throw new UnsupportedOperationException("Utility class");
@@ -395,4 +393,3 @@ public final class Types {
         }
     }
 }
-