org.simpleflatmapper.reflect.Getter Maven / Gradle / Ivy
package org.simpleflatmapper.reflect;
import org.simpleflatmapper.reflect.getter.FieldGetter;
import org.simpleflatmapper.reflect.getter.MethodGetter;
/**
* Interface representing a Getter of a property of type P on a object of type T.
*
* use {@link ObjectGetterFactory} to instantiate.
* @see ObjectGetterFactory
* @see MethodGetter
* @see FieldGetter
* @param the targeted type
* @param the property type
*/
public interface Getter {
/**
* Return the property from the specified object.
* @param target the object to get the property from
* @return the property
* @throws Exception if anything goes wrong
*/
P get(T target) throws Exception;
}