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

org.meanbean.factories.collections.ArrayListFactory Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 2.0.3
Show newest version
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();
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy