Class Cast

    • Method Detail

      • cast

        public static <T> T cast​(Object o)
        Returns the provided object cast to the generic parameter type or null when the argument is null.
        Type Parameters:
        T - the type to cast
        Parameters:
        o - object to cast
        Returns:
        object after casting or null if the object was null
        Throws:
        ClassCastException - if the object cannot be cast to the provided type