org.gradle.util
Class WrapUtil

java.lang.Object
  extended by org.gradle.util.WrapUtil

public class WrapUtil
extends java.lang.Object

Common methods to wrap objects in generic collections.


Constructor Summary
WrapUtil()
           
 
Method Summary
static
<T> T[]
toArray(T... items)
           
static
<K,V> java.util.Map<K,V>
toLinkedMap(K key, V value)
          Wraps the given key and value in a mutable ordered map.
static
<T> java.util.Set<T>
toLinkedSet(T... items)
          Wraps the given items in a mutable ordered set.
static
<T> java.util.List<T>
toList(java.lang.Iterable<? extends T> items)
          Wraps the given items in a mutable list.
static
<T> java.util.List<T>
toList(T... items)
          Wraps the given items in a mutable list.
static
<K,V> java.util.Map<K,V>
toMap(K key, V value)
          Wraps the given key and value in a mutable unordered map.
static java.util.Properties toProperties(java.lang.String key, java.lang.String value)
          Wraps the given key and value in a mutable properties instance.
static
<T> java.util.Set<T>
toSet(T... items)
          Wraps the given items in a mutable unordered set.
static
<K,V> java.util.SortedMap<K,V>
toSortedMap(K key, V value)
          Wraps the given key and value in a mutable sorted map.
static
<T> java.util.SortedSet<T>
toSortedSet(java.util.Comparator<T> comp, T... items)
          Wraps the given items in a mutable sorted set using the given comparator.
static
<T> java.util.SortedSet<T>
toSortedSet(T... items)
          Wraps the given items in a mutable sorted set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WrapUtil

public WrapUtil()
Method Detail

toSet

public static <T> java.util.Set<T> toSet(T... items)
Wraps the given items in a mutable unordered set.


toLinkedSet

public static <T> java.util.Set<T> toLinkedSet(T... items)
Wraps the given items in a mutable ordered set.


toSortedSet

public static <T> java.util.SortedSet<T> toSortedSet(T... items)
Wraps the given items in a mutable sorted set.


toSortedSet

public static <T> java.util.SortedSet<T> toSortedSet(java.util.Comparator<T> comp,
                                                     T... items)
Wraps the given items in a mutable sorted set using the given comparator.


toList

public static <T> java.util.List<T> toList(T... items)
Wraps the given items in a mutable list.


toList

public static <T> java.util.List<T> toList(java.lang.Iterable<? extends T> items)
Wraps the given items in a mutable list.


toMap

public static <K,V> java.util.Map<K,V> toMap(K key,
                                             V value)
Wraps the given key and value in a mutable unordered map.


toSortedMap

public static <K,V> java.util.SortedMap<K,V> toSortedMap(K key,
                                                         V value)
Wraps the given key and value in a mutable sorted map.


toLinkedMap

public static <K,V> java.util.Map<K,V> toLinkedMap(K key,
                                                   V value)
Wraps the given key and value in a mutable ordered map.


toProperties

public static java.util.Properties toProperties(java.lang.String key,
                                                java.lang.String value)
Wraps the given key and value in a mutable properties instance.


toArray

public static <T> T[] toArray(T... items)