/*
 * Copyright 2012 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package bingo.lang;

import java.util.List;
import java.util.Set;

import bingo.lang.collections.WrappedImmutableList;
import bingo.lang.collections.WrappedImmutableSet;

public class Immutables {

	protected Immutables(){
		
	}
	
	public static <E> List<E> listOf(List<E> list) {
		return new WrappedImmutableList<E>(list);
	}
	
	public static <E> List<E> listOf(Iterable<E> iterable) {
		return new WrappedImmutableList<E>(Enumerables.toList(iterable));
	}
	
	public static <E> List<E> listOf(E... array) {
		return new WrappedImmutableList<E>(Arrays.toList(array));
	}
	
	public static <E> Set<E> setOf(Set<E> set) {
		return new WrappedImmutableSet<E>(set);
	}
	
	public static <E> Set<E> setOf(Iterable<E> iterable) {
		return new WrappedImmutableSet<E>(Enumerables.toSet(iterable));
	}
	
	public static <E> Set<E> setOf(E... array) {
		return new WrappedImmutableSet<E>(Arrays.toSet(array));
	}

}
@@ -693,16 +693,45 @@
 il.Set;%0D
+%0Aimport java.util.Map.Entry;%0D
 %0A%0D%0Aimpor
@@ -829,16 +829,57 @@
 bleSet;%0D
+%0Aimport bingo.lang.tuple.ImmutableEntry;%0D
 %0A%0D%0Apubli
@@ -1634,9 +1634,120 @@
 %0D%0A%09%7D%0D%0A%0D%0A
+%09public static %3CK,V%3E Entry%3CK, V%3E entryOf(K key,V value) %7B%0D%0A%09%09return new ImmutableEntry%3CK, V%3E(key, value);%0D%0A%09%7D%0D%0A
 %7D

add Immutables.entryOf