public final class CastUtility extends Object
public static Object cast(Object object, Class<?> castTo)
castTo
.
This is not a generic solution but does some handy conversion like Long to Integer so that the BASIC programs can easily call Java methods that accept int, float etc.
Casting is done on best effort. If the class is unknown to the utility then the original object is returned and it is up to the higher level code to recognize the class mis-alignment.
object
- the object to convert.castTo
- the class that the result has to belong to.public static Object toObject(RightValue rightValue)
Copyright © 2013 Verhas and Verhas Software Craftsmen. All Rights Reserved.