Remove overloads of NonNullUtils#checkNotNull()
[deliverable/tracecompass.git] / common / org.eclipse.tracecompass.common.core / src / org / eclipse / tracecompass / common / core / NonNullUtils.java
index 119c3fac641c39965cb395ee93203ff0daffe47d..3a46d9aad0eae3530ebeb1f5a81a020f9a79a370 100644 (file)
@@ -13,7 +13,6 @@
 package org.eclipse.tracecompass.common.core;
 
 import java.util.Arrays;
-import java.util.Map;
 import java.util.stream.Stream;
 
 import org.eclipse.jdt.annotation.NonNull;
@@ -91,68 +90,6 @@ public final class NonNullUtils {
         return obj;
     }
 
-    /**
-     * Convert a non-annotated [] array reference to a @NonNull one.
-     *
-     * Note that this method does not check the array contents itself, which can
-     * still contain null elements.
-     *
-     * @param array
-     *            The array whose reference should not be null
-     * @return A {@link NonNull} reference to the array
-     * @throws NullPointerException
-     *             If the reference was actually null
-     * @since 2.0
-     */
-    public static <T> T[] checkNotNull(T @Nullable [] array) {
-        if (array == null) {
-            throw new NullPointerException();
-        }
-        return array;
-    }
-
-    /**
-     * Convert a non-annotated {@link Iterable} to a NonNull one.
-     *
-     * Note that, unlike {{@link #checkNotNull(Object)}}, this method does not
-     * check the contents itself, which can still contain null elements.
-     *
-     * @param container
-     *            The iterable whose reference should not be null
-     * @return A {@link NonNull} reference to the Iterable. The original class
-     *         type is preserved.
-     * @throws NullPointerException
-     *             If the reference was actually null
-     * @since 2.0
-     */
-    public static <T, C extends Iterable<T>> C checkNotNull(@Nullable C container) {
-        if (container == null) {
-            throw new NullPointerException();
-        }
-        return container;
-    }
-
-    /**
-     * Convert a non-annotated {@link Map} to a NonNull one.
-     *
-     * Note that, unlike {{@link #checkNotNull(Object)}}, this method does not
-     * check the keys or values themselves, which can still contain null
-     * elements.
-     *
-     * @param map
-     *            The map whose reference should not be null
-     * @return A {@link NonNull} reference to the Map
-     * @throws NullPointerException
-     *             If the reference was actually null
-     * @since 2.0
-     */
-    public static <K, V, M extends Map<K, V>> M checkNotNull(@Nullable M map) {
-        if (map == null) {
-            throw new NullPointerException();
-        }
-        return map;
-    }
-
     /**
      * Ensures a {@link Stream} does not contain any null values.
      *
This page took 0.037512 seconds and 5 git commands to generate.