org.meanbean.factories.collections.ArrayListFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of meanbean Show documentation
Show all versions of meanbean Show documentation
Mean Bean is an open source Java test library that tests equals and hashCode contract compliance, as well as
JavaBean/POJO getter and setter methods.
package org.meanbean.factories.collections;
import java.util.ArrayList;
import java.util.List;
import org.meanbean.lang.Factory;
import org.meanbean.util.RandomValueGenerator;
/**
* Factory that creates random ArrayLists of objects of the specified type.
*
* @author Graham Williamson
*
* @param
* The data type of the object this Factory creates ArrayLists of.
*/
public class ArrayListFactory extends ListFactoryBase {
/** Unique version ID of this Serializable class. */
private static final long serialVersionUID = 1L;
/**
* Construct a new ArrayList object Factory.
*
* @param randomValueGenerator
* A random value generator used by the Factory to generate random values.
* @param itemFactory
* Factory used to create each ArrayList item.
*/
public ArrayListFactory(RandomValueGenerator randomValueGenerator, Factory itemFactory) {
super(randomValueGenerator, itemFactory);
}
/**
* Create a new concrete List instance that this Factory will return populated.
*
* @return A concrete List of the type created by this Factory.
*/
protected List createList() {
return new ArrayList();
}
}