org.simpleflatmapper.reflect.Setter Maven / Gradle / Ivy
package org.simpleflatmapper.reflect;
import org.simpleflatmapper.reflect.getter.FieldSetter;
import org.simpleflatmapper.reflect.setter.MethodSetter;
/**
* Represent a setter of a property of type P on a object of type T.
*
* use {@link ObjectSetterFactory} to instantiate.
*
* @see ObjectSetterFactory
* @see FieldSetter
* @see MethodSetter
* @param the target type
* @param the property type
*/
public interface Setter {
/**
* Set the properties on the target object to value.
* @param target the target to set the value on
* @param value the value to set
* @throws Exception if anything goes wrong
*/
void set(T target, P value) throws Exception;
}