com.softicar.platform.common.container.list.ListFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of platform-common Show documentation
Show all versions of platform-common Show documentation
The SoftiCAR Platform is a lightweight, Java-based library to create interactive business web applications.
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);
}
}