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

com.github.anhem.testpopulator.internal.carrier.CollectionCarrier Maven / Gradle / Ivy

Go to download

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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy