com.github.anhem.testpopulator.internal.carrier.CollectionCarrier Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of test-populator Show documentation
Show all versions of test-populator Show documentation
Populate java classes with fixed or random data using reflection. Facilitates the creation of objects in tests.
The newest version!
package com.github.anhem.testpopulator.internal.carrier;
import com.github.anhem.testpopulator.internal.object.ObjectFactory;
import java.lang.reflect.Parameter;
import java.lang.reflect.Type;
import java.util.Arrays;
import java.util.List;
import static com.github.anhem.testpopulator.internal.util.PopulateUtil.toArgumentTypes;
public class CollectionCarrier extends ClassCarrier {
private final List argumentTypes;
public CollectionCarrier(Class clazz, Type[] typeArguments, ObjectFactory objectFactory, List visited) {
super(clazz, objectFactory, visited);
this.argumentTypes = Arrays.asList(typeArguments);
}
public CollectionCarrier(Class clazz, Parameter parameter, ObjectFactory objectFactory, List visited) {
super(clazz, objectFactory, visited);
this.argumentTypes = toArgumentTypes(parameter);
}
public List getArgumentTypes() {
return argumentTypes;
}
}