Class Cast


  • public final class Cast
    extends Object
    Class to cast an Object to another Object
    • Method Detail

      • cast

        public static <T> T cast​(Object object)
        Method to cast an Object to another Object
        Type Parameters:
        T -
        Parameters:
        object -
        Returns:
      • cast

        public static <T> T cast​(Object object,
                                 Supplier<RuntimeException> runtimeExceptionSupplier)
        Method to cast an Object to another Object, throwing an Exception provided by the Supplier if there is a ClassCastException
        Type Parameters:
        T -
        Parameters:
        object -
        Returns: