Class UncheckedCasts

java.lang.Object
ru.progrm_jarvis.javacommons.util.UncheckedCasts

public final class UncheckedCasts extends Object
Commonly used unchecked casts.
API note
parameters can be null because casting of null is always correct
  • Method Details

    • uncheckedClassCast

      @Contract("_ -> param1") public static <T> Class<T> uncheckedClassCast(Class<?> type)
      Casts the given class object into the specific one.
      Type Parameters:
      T - exact wanted type of class object
      Parameters:
      type - raw-typed class object
      Returns:
      the provided class object with its type cast to the specific one
      API note
      this is effectively no-op