Top Constructors Methods
org.apache.logging.log4j.util

public final Class Cast

extends Object
Class Inheritance
Annotations
@InternalApi

Constructor Summary

AccessConstructor and Description
private
Cast()

Method Summary

Modifier and TypeMethod and Description
public static <
the type to cast
T
>
T

Returns:

object after casting or null if the object was null
cast
(final Object
object to cast
o
)

Returns the provided object cast to the generic parameter type or null when the argument is null.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Castback to summary
private Cast()

Method Detail

castback to summary
public static <T> T cast(final Object o)

Returns the provided object cast to the generic parameter type or null when the argument is null.

Parameters
<T>
the type to cast
o:Object

object to cast

Returns:T

object after casting or null if the object was null

Exceptions
ClassCastException:
if the object cannot be cast to the provided type