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

org.meanbean.factories.collections.TreeMapFactory 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.Map;
import java.util.TreeMap;

import org.meanbean.lang.Factory;
import org.meanbean.util.RandomValueGenerator;

/**
 * Factory that creates random TreeMaps of objects of the specified type.
 * 
 * @param 
 *            The data type of the keys the Maps created by this Factory use.
 * @param 
 *            The data type of the values the Maps created by this Factory contain.
 */
public class TreeMapFactory extends MapFactoryBase {

	/** Unique version ID of this Serializable class. */
	private static final long serialVersionUID = 1L;

	/**
	 * Construct a new TreeMap object Factory.
	 * 
	 * @param randomValueGenerator
	 *            A random value generator used by the Factory to generate random values.
	 * @param keyFactory
	 *            Factory used to create each Map key.
	 * @param valueFactory
	 *            Factory used to create each Map value.
	 */
	public TreeMapFactory(RandomValueGenerator randomValueGenerator, Factory keyFactory, Factory valueFactory) {
		super(randomValueGenerator, keyFactory, valueFactory);
	}

	/**
	 * Create a new concrete Map instance that this Factory will return populated.
	 * 
	 * @return A concrete Map of the type created by this Factory.
	 */
	@Override
	protected Map createMap() {
		return new TreeMap();
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy