Remove of/copyOf factory methods 52/32852/5
authorRobert Varga <robert.varga@pantheon.sk>
Fri, 15 Jan 2016 20:56:12 +0000 (21:56 +0100)
committerTony Tkacik <ttkacik@cisco.com>
Tue, 26 Jan 2016 08:25:44 +0000 (08:25 +0000)
These have been deprecated in favor of their ordered/unordered
counterparts, remove them.

Change-Id: Ide5ecfb1141b03597f72757fc91d56715d18c308
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
common/util/src/main/java/org/opendaylight/yangtools/util/ImmutableOffsetMap.java
common/util/src/main/java/org/opendaylight/yangtools/util/MutableOffsetMap.java
common/util/src/main/java/org/opendaylight/yangtools/util/SharedSingletonMap.java

index 7e5dd349ff0b268886c966792a3134e4446feef8..855e8a2aaa557c4b5dd772a6a62e83ace57d1590 100644 (file)
@@ -101,23 +101,6 @@ public abstract class ImmutableOffsetMap<K, V> implements UnmodifiableMapPhase<K
 
     abstract void setFields(List<K> keys, V[] values) throws IOException;
 
-    /**
-     * Create an {@link ImmutableOffsetMap} as a copy of an existing map. This is actually not completely true,
-     * as this method returns an {@link ImmutableMap} for empty and singleton inputs, as those are more memory-efficient.
-     * This method also recognizes {@link ImmutableOffsetMap} on input, and returns it back without doing anything else.
-     * It also recognizes {@link MutableOffsetMap} (as returned by {@link #toModifiableMap()}) and makes an efficient
-     * copy of its contents. All other maps are converted to an {@link ImmutableOffsetMap} with the same iteration
-     * order as input.
-     *
-     * @param m Input map, may not be null.
-     * @return An isolated, immutable copy of the input map
-     * @deprecated Use {@link #orderedCopyOf(Map)} or {@link #unorderedCopyOf(Map)} instead.
-     */
-    @Deprecated
-    @Nonnull public static <K, V> Map<K, V> copyOf(@Nonnull final Map<K, V> m) {
-        return orderedCopyOf(m);
-    }
-
     /**
      * Create an {@link ImmutableOffsetMap} as a copy of an existing map. This is actually not completely true,
      * as this method returns an {@link ImmutableMap} for empty and singleton inputs, as those are more memory-efficient.
index 2c3ea479a247f4f932aedcc71c6ead4e00676bc8..45798d622b36f3b667f4167a0b672005ba2751e6 100644 (file)
@@ -143,14 +143,6 @@ public abstract class MutableOffsetMap<K, V> extends AbstractMap<K, V> implement
         this.needClone = false;
     }
 
-    /**
-     * @deprecated Use {@link #orderedCopyOf(Map)} or {@link #unorderedCopyOf(Map)} instead.
-     */
-    @Deprecated
-    public static <K, V> MutableOffsetMap<K, V> copyOf(final Map<K, V> m) {
-        return orderedCopyOf(m);
-    }
-
     public static <K, V> MutableOffsetMap<K, V> orderedCopyOf(final Map<K, V> m) {
         if (m instanceof Ordered) {
             return ((Ordered<K, V>) m).clone();
@@ -175,14 +167,6 @@ public abstract class MutableOffsetMap<K, V> extends AbstractMap<K, V> implement
         return new Unordered<>(m);
     }
 
-    /**
-     * @deprecated Use {@link #ordered()} or {@link #unordered()} instead.
-     */
-    @Deprecated
-    public static <K, V> MutableOffsetMap<K, V> of() {
-        return ordered();
-    }
-
     public static <K, V> MutableOffsetMap<K, V> ordered() {
         return new MutableOffsetMap.Ordered<>();
     }
index ef420b4b578cd80f526ba4f5ea22d6fbd5225ee6..6295e182e98ed9c726e4e2f8959a1ccfc4eeee91 100644 (file)
@@ -69,14 +69,6 @@ public abstract class SharedSingletonMap<K, V> implements Serializable, Unmodifi
         this.value = Preconditions.checkNotNull(value);
     }
 
-    /**
-     * @deprecated Use {@link #orderedOf(Object, Object)} or {@link #unorderedOf(Object, Object)} instead.
-     */
-    @Deprecated
-    public static <K, V> SharedSingletonMap<K, V> of(final K key, final V value) {
-        return new Ordered<>(key, value);
-    }
-
     public static <K, V> SharedSingletonMap<K, V> orderedOf(final K key, final V value) {
         return new Ordered<>(key, value);
     }
@@ -85,14 +77,6 @@ public abstract class SharedSingletonMap<K, V> implements Serializable, Unmodifi
         return new Unordered<>(key, value);
     }
 
-    /**
-     * @deprecated Use {@link #orderedCopyOf(Map)} or {@link #unorderedCopyOf(Map)} instead.
-     */
-    @Deprecated
-    public static <K, V> SharedSingletonMap<K, V> copyOf(final Map<K, V> m) {
-        return orderedCopyOf(m);
-    }
-
     public static <K, V> SharedSingletonMap<K, V> orderedCopyOf(final Map<K, V> m) {
         Preconditions.checkArgument(m.size() == 1);