Package org.apache.logging.log4j.util
Class Cast
- java.lang.Object
-
- org.apache.logging.log4j.util.Cast
-
@InternalApi public final class Cast extends java.lang.Object
- Since:
- 2.22.0
-
-
Constructor Summary
Constructors Modifier Constructor Description privateCast()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> Tcast(java.lang.Object o)Returns the provided object cast to the generic parameter type or null when the argument is null.
-
-
-
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
-
-