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

com.softicar.platform.common.container.list.ListFactory Maven / Gradle / Ivy

Go to download

The SoftiCAR Platform is a lightweight, Java-based library to create interactive business web applications.

There is a newer version: 50.0.0
Show newest version
package com.softicar.platform.common.container.list;

import java.util.ArrayList;
import java.util.Collection;

/**
 * Static factory methods for lists.
 * 
 * @author Oliver Richers
 */
public abstract class ListFactory {

	/**
	 * Creates a new and empty {@link ArrayList}.
	 */
	public static  ArrayList createArrayList() {

		return new ArrayList<>();
	}

	/**
	 * Creates a new and empty {@link ArrayList} with the specified initial
	 * capacity.
	 * 
	 * @param initialCapacity
	 *            the initial capacity of the returned list
	 */
	public static  ArrayList createArrayList(int initialCapacity) {

		return new ArrayList<>(initialCapacity);
	}

	/**
	 * Creates a new {@link ArrayList} and copies the elements of the specified
	 * collection.
	 * 
	 * @param other
	 *            the collection to copy the elements from
	 */
	public static  ArrayList createArrayList(Collection other) {

		return new ArrayList<>(other);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy