consulting.omnia.util.cast.AbstractCast Maven / Gradle / Ivy
package consulting.omnia.util.cast;
/**
* @author Ronaldo Blanc ronaldoblanc at omnia.consulting
* @since Jul 17, 2015
* @version 1.2.0
*/
public abstract class AbstractCast {
/**
* Simple casts the value as type.
* If the object is suitable, so no conversion.
*
* @param value object to cast
* @param type class to cast object as
* @param returning type
* @return if possible returns value
cast as class type
*/
protected static R castAs(final Object value, final Class type) {
return type.cast(value);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy