Class Cast


  • @InternalApi
    public final class Cast
    extends java.lang.Object
    Since:
    2.22.0
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Cast()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> T cast​(java.lang.Object o)
      Returns the provided object cast to the generic parameter type or null when the argument is null.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Cast

        private Cast()
    • Method Detail

      • cast

        public static <T> T cast​(java.lang.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:
        java.lang.ClassCastException - if the object cannot be cast to the provided type