Map system-ordered leaf-lists to Set<T>
[mdsal.git] / binding / mdsal-binding-model-ri / src / main / java / org / opendaylight / mdsal / binding / model / ri / Types.java
index 132de64d03f1ea56f1e9488b436befc5d7bd47ef..b1e53087ca5e6a2c02d86a4a379ecf2725772321 100644 (file)
@@ -65,6 +65,7 @@ public final class Types {
     private static final @NonNull ConcreteType SERIALIZABLE = typeForClass(Serializable.class);
     private static final @NonNull ConcreteType SET_TYPE = typeForClass(Set.class);
     private static final @NonNull ParameterizedType LIST_TYPE_WILDCARD = parameterizedTypeFor(LIST_TYPE);
+    private static final @NonNull ParameterizedType SET_TYPE_WILDCARD = parameterizedTypeFor(SET_TYPE);
 
     /**
      * It is not desirable to create instance of this class.
@@ -194,6 +195,15 @@ public final class Types {
         return parameterizedTypeFor(SET_TYPE, valueType);
     }
 
+    /**
+     * Returns an instance of {@link ParameterizedType} describing the typed {@link Set}&lt;?&gt;.
+     *
+     * @return Description of type instance of Set
+     */
+    public static @NonNull ParameterizedType setTypeWildcard() {
+        return SET_TYPE_WILDCARD;
+    }
+
     /**
      * Returns an instance of {@link ParameterizedType} describing the typed {@link List}&lt;V&gt; with concrete type
      * of value.
@@ -214,6 +224,10 @@ public final class Types {
         return LIST_TYPE_WILDCARD;
     }
 
+    public static boolean isSetType(final ParameterizedType type) {
+        return SET_TYPE.equals(type.getRawType());
+    }
+
     public static boolean isListType(final ParameterizedType type) {
         return LIST_TYPE.equals(type.getRawType());
     }