fitlibraryGeneric.specify.genericFinder.GenericAndNonGenericFinder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fitlibrary Show documentation
Show all versions of fitlibrary Show documentation
FitLibrary provides general-purpose fixtures (and runners) for storytests with Fit and FitNesse.
The newest version!
package fitlibraryGeneric.specify.genericFinder;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import fitlibrary.traverse.DomainAdapter;
@SuppressWarnings("unchecked")
public class GenericAndNonGenericFinder implements DomainAdapter {
@SuppressWarnings("unused")
private Pair integerIntegerPair;
public void setIntegerIntegerPair(Pair pair) {
this.integerIntegerPair = pair;
}
public Pair findPair(@SuppressWarnings("unused") String key) {
return null;
}
public Pair findPair(@SuppressWarnings("unused") String key, Type type) {
if (type instanceof ParameterizedType && ((ParameterizedType)type).getActualTypeArguments()[0] == Integer.class)
return new Pair(1,2);
return null;
}
public Object getSystemUnderTest() {
return null;
}
}