dev.vality.woody.api.proxy.SingleTargetProvider Maven / Gradle / Ivy
package dev.vality.woody.api.proxy;
public class SingleTargetProvider implements InvocationTargetProvider {
private final Class targetType;
private final T target;
public SingleTargetProvider(T target) {
this((Class) target.getClass(), target);
}
public SingleTargetProvider(Class targetType, T target) {
this.targetType = targetType;
this.target = target;
}
@Override
public Class getTargetType() {
return targetType;
}
@Override
public T getTarget() {
return target;
}
@Override
public boolean isSingleTarget() {
return true;
}
@Override
public void releaseTarget(T target) {
}
}