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

aQute.libg.generics.Create Maven / Gradle / Ivy

Go to download

A command line utility and Ant plugin to wrap, build, or examine bundles.

There is a newer version: 2.4.0
Show newest version
package aQute.libg.generics;

import java.util.*;

public class Create {

	public static  Map map() {
		return new LinkedHashMap();
	}

	public static  Map map(Class key, Class value) {
		return Collections.checkedMap(new LinkedHashMap(), key, value);
	}

	public static  List list() {
		return new ArrayList();
	}

	public static  List list(Class c) {
		return Collections.checkedList(new ArrayList(), c);
	}

	public static  Set set() {
		return new HashSet();
	}

	public static  Set set(Class c) {
		return Collections.checkedSet(new HashSet(), c);
	}

	public static  List list(T[] source) {
		return new ArrayList(Arrays.asList(source));
	}

	public static  Set set(T[] source) {
		return new HashSet(Arrays.asList(source));
	}

	public static  Map copy(Map source) {
		return new LinkedHashMap(source);
	}

	public static  List copy(List source) {
		return new ArrayList(source);
	}

	public static  Set copy(Collection source) {
		if (source == null)
			return set();
		return new HashSet(source);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy