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

org.sfm.reflect.impl.FieldSetter Maven / Gradle / Ivy

package org.sfm.reflect.impl;

import java.lang.reflect.Field;
import java.lang.reflect.Type;

import org.sfm.reflect.Setter;

public final class FieldSetter implements Setter {

	private final Field field;
	private final Type type; 
	
	public FieldSetter(final Field field) {
		this.field = field;
		this.type =  field.getGenericType();
	}

	public void set(final T target, final P value) throws IllegalArgumentException, IllegalAccessException {
		field.set(target, value);
	}

	@Override
	public Type getPropertyType() {
		return type;
	}
	
	public Field getField() {
		return field;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy