Remove util.Immutables 53/97653/3
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 27 Sep 2021 13:48:45 +0000 (15:48 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 27 Sep 2021 13:53:04 +0000 (15:53 +0200)
This class has been deprecated for removal in a previous release, remove
it now.

JIRA: YANGTOOLS-1331
Change-Id: Iccbba68c82a0f876f230041f02a3519c979995e0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
common/util/src/main/java/org/opendaylight/yangtools/util/Immutables.java [deleted file]

diff --git a/common/util/src/main/java/org/opendaylight/yangtools/util/Immutables.java b/common/util/src/main/java/org/opendaylight/yangtools/util/Immutables.java
deleted file mode 100644 (file)
index ebf4136..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2014 Cisco 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.yangtools.util;
-
-import static com.google.common.base.Preconditions.checkArgument;
-
-import com.google.common.collect.ImmutableSet;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import org.opendaylight.yangtools.concepts.Immutable;
-import org.opendaylight.yangtools.concepts.Mutable;
-
-@Deprecated(since = "7.0.9", forRemoval = true)
-public final class Immutables {
-    private static final ImmutableSet<Class<?>> KNOWN_IMMUTABLES = ImmutableSet.of(
-            Integer.class, Short.class, BigDecimal.class, BigInteger.class, Byte.class, Character.class, Double.class,
-            Float.class, String.class, Boolean.class, Void.class);
-
-    private Immutables() {
-        // Hidden on purpose
-    }
-
-    /**
-     * Determines if object is known to be immutable
-     *
-     * <p>Note: This method may return false to immutable objects which
-     * immutability is not known, was defined not using concepts term.
-     *
-     * @param obj Reference to check
-     * @return true if object is known to be immutable false otherwise.
-     */
-    public static boolean isImmutable(final Object obj) {
-        checkArgument(obj != null,"Object should not be null");
-        if (obj instanceof Mutable) {
-            return false;
-        } else if (obj instanceof Immutable || obj instanceof String || KNOWN_IMMUTABLES.contains(obj.getClass())) {
-            return true;
-        }
-        return false;
-    }
-}