@ SuppressWarnings ( "unchecked" ) public static final < T extends Serializable > T castValue ( final Object value ) { return value != null ? ( T ) value : null ; }
Type - and null - safe cast of variable - value .