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");
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
* 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");
}
}
@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);