
org.codemonkey.javareflection.FieldWrapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-reflection Show documentation
Show all versions of java-reflection Show documentation
Java Reflection provides a small package with nifty reflection features that will help with finding constructors, methods and value conversions
The newest version!
package org.codemonkey.javareflection;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
/**
* A wrapper class that keeps the property and its setter/getter in one place.
*
* @author Benny Bottema
*/
public class FieldWrapper {
private final Field field;
private final Method getter;
private final Method setter;
/**
* Initializes the wrapper with field, getter and setter, all optional.
*
* @param field A {@link Field}.
* @param getter A getter {@link Method} for the field.
* @param setter A setter {@link Method} for the field.
*/
public FieldWrapper(final Field field, final Method getter, final Method setter) {
this.field = field;
this.getter = getter;
this.setter = setter;
}
/**
* @return {@link #field}.
*/
public Field getField() {
return field;
}
/**
* @return {@link #getter}.
*/
public Method getGetter() {
return getter;
}
/**
* @return {@link #setter}.
*/
public Method getSetter() {
return setter;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy