Merge changes I1a5340f1,I9bb2bdd9
authorMartin Vitez <mvitez@cisco.com>
Mon, 28 Jul 2014 07:20:10 +0000 (07:20 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 28 Jul 2014 07:20:10 +0000 (07:20 +0000)
* changes:
  Implement DatastoreIdentifierBuilder
  Add String to known-immutable classes

common/concepts/src/main/java/org/opendaylight/yangtools/concepts/util/Immutables.java
model/ietf/ietf-restconf/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/restconf/rev131019/DatastoreIdentifierBuilder.java

index d659123f9710e81a6fbc4c6df8ef3978e283c786..cc2d0186d4a03c5e7af8eaca829c3d278dc6a2cd 100644 (file)
@@ -16,7 +16,7 @@ import java.util.Set;
 import org.opendaylight.yangtools.concepts.Immutable;
 import org.opendaylight.yangtools.concepts.Mutable;
 
-public class Immutables {
+public final class Immutables {
 
     private Immutables() {
         throw new UnsupportedOperationException("Helper class");
@@ -25,7 +25,7 @@ public class Immutables {
     public static final Set<Class<?>> KNOWN_IMMUTABLES = Immutables.<Class<?>> asHashSet(
             //
             Integer.class, Short.class, BigDecimal.class, BigInteger.class, Byte.class, Character.class, Double.class,
-            Float.class);
+            Float.class, String.class);
 
     /**
      * Determines if object is known to be immutable
@@ -37,7 +37,7 @@ public class Immutables {
      *            Reference to check
      * @return true if object is known to be immutable false otherwise.
      */
-    public static boolean isImmutable(Object o) {
+    public static boolean isImmutable(final Object o) {
         if (o == null) {
             throw new IllegalArgumentException("Object should not be null");
         }
@@ -54,7 +54,7 @@ public class Immutables {
     }
 
     @SafeVarargs
-    private static <E> Set<E> asHashSet(E... list) {
+    private static <E> Set<E> asHashSet(final E... list) {
         HashSet<E> ret = new HashSet<>();
         for (E e : list) {
             ret.add(e);
index 35b84e3462e534c0623cef1106a49d224a023220..42defe53ca2cbba21db87cb09b3041739a9995d3 100644 (file)
@@ -1,20 +1,20 @@
 /*
-* Copyright (c) 2014 Brocade Communications Systems, Inc. and others.  All rights reserved.
-*
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0 which accompanies this distribution,
-* and is available at http://www.eclipse.org/legal/epl-v10.html
-*/
+ * Copyright (c) 2014 Brocade Communications Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
 package org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.restconf.rev131019;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.restconf.rev131019.DatastoreIdentifier;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.restconf.rev131019.DatastoreIdentifier.Enumeration;
 
 
 /**
-**/
+ **/
 public class DatastoreIdentifierBuilder {
 
-    public static DatastoreIdentifier getDefaultInstance(String defaultValue) {
-        throw new UnsupportedOperationException("Not yet implemented");
+    public static DatastoreIdentifier getDefaultInstance(final String defaultValue) {
+        return new DatastoreIdentifier(Enumeration.valueOf(defaultValue));
     }
 
 }