All Downloads are FREE. Search and download functionalities are using the official Maven repository.

panda.cast.Castor Maven / Gradle / Ivy

Go to download

Panda Core is the core module of Panda Framework, it contains commonly used utility classes similar to apache-commons.

There is a newer version: 1.8.0
Show newest version
package panda.cast;



/**
 * Castor interface 
 *
 * @param  source type
 * @param  target type
 * 
 */
public interface Castor {
	/**
	 * cast value
	 * @param context context
	 * @param value value
	 * @return casted value
	 */
	T cast(S value, CastContext context);
	
	/**
	 * cast value to the provided target object,
	 * NOTE: if the target is not a mutable object, a new object will be returned.
	 * @param value value
	 * @param target target object
	 * @return casted value
	 */
	T castTo(S value, T target);

	/**
	 * cast value to the provided target object,
	 * NOTE: if the target is not a mutable object, a new object will be returned.
	 * @param value value
	 * @param target target object
	 * @param context context
	 * @return casted value
	 */
	T castTo(S value, T target, CastContext context);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy