Class Cast

java.lang.Object
org.apache.logging.log4j.util.Cast

@InternalApi public final class Cast extends Object
  • Method Details

    • 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