Package com.yahoo.reflection
Class Casting
- java.lang.Object
-
- com.yahoo.reflection.Casting
-
public class Casting extends java.lang.Object
Utility methods for doing casting- Author:
- Tony Vaagenes
-
-
Constructor Summary
Constructors Constructor Description Casting()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> java.util.Optional<T>
cast(java.lang.Class<T> targetClass, java.lang.Object instance)
Returns the casted instance if it is assignment-compatible with targetClass, or empty otherwise.
-