com.atlassian.jira.util.collect
Class CollectionBuilder<T>

java.lang.Object
  extended by com.atlassian.jira.util.collect.CollectionBuilder<T>
Type Parameters:
T - contained in the created collections.

Deprecated. use google quava eg. ImmutableList.builder()

@NotThreadSafe
@Deprecated
public final class CollectionBuilder<T>
extends Object

Convenience class for creating collections (Set and List) instances or enclosed iterables.

The default methods asList() and asSet() and asSortedSet() create immutable collections.


Method Summary
 CollectionBuilder<T> add(T element)
          Deprecated.  
 CollectionBuilder<T> addAll(Collection<? extends T> elements)
          Deprecated.  
<E extends T>
CollectionBuilder<T>
addAll(E... elements)
          Deprecated.  
 CollectionBuilder<T> addAll(Enumeration<? extends T> elements)
          Deprecated.  
 List<T> asArrayList()
          Deprecated.  
 Collection<T> asCollection()
          Deprecated.  
 EnclosedIterable<T> asEnclosedIterable()
          Deprecated.  
 Set<T> asHashSet()
          Deprecated.  
 Set<T> asImmutableListOrderedSet()
          Deprecated.  
 List<T> asLinkedList()
          Deprecated.  
 List<T> asList()
          Deprecated.  
 Set<T> asListOrderedSet()
          Deprecated.  
 Collection<T> asMutableCollection()
          Deprecated.  
 List<T> asMutableList()
          Deprecated.  
 Set<T> asMutableSet()
          Deprecated.  
 SortedSet<T> asMutableSortedSet()
          Deprecated.  
 Set<T> asSet()
          Deprecated.  
 SortedSet<T> asSortedSet()
          Deprecated. Return a SortedSet of the elements of this builder in their natural order.
 SortedSet<T> asSortedSet(Comparator<? super T> comparator)
          Deprecated.  
 SortedSet<T> asTreeSet()
          Deprecated.  
static
<T> List<T>
list(T... elements)
          Deprecated.  
static
<T> CollectionBuilder<T>
newBuilder()
          Deprecated.  
static
<T> CollectionBuilder<T>
newBuilder(T... elements)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newBuilder

public static <T> CollectionBuilder<T> newBuilder()
Deprecated. 

newBuilder

public static <T> CollectionBuilder<T> newBuilder(T... elements)
Deprecated. 

list

public static <T> List<T> list(T... elements)
Deprecated. 

add

public CollectionBuilder<T> add(T element)
Deprecated. 

addAll

public <E extends T> CollectionBuilder<T> addAll(E... elements)
Deprecated. 

addAll

public CollectionBuilder<T> addAll(Collection<? extends T> elements)
Deprecated. 

addAll

public CollectionBuilder<T> addAll(Enumeration<? extends T> elements)
Deprecated. 

asCollection

public Collection<T> asCollection()
Deprecated. 

asMutableCollection

public Collection<T> asMutableCollection()
Deprecated. 

asArrayList

public List<T> asArrayList()
Deprecated. 

asLinkedList

public List<T> asLinkedList()
Deprecated. 

asList

public List<T> asList()
Deprecated. 

asMutableList

public List<T> asMutableList()
Deprecated. 

asHashSet

public Set<T> asHashSet()
Deprecated. 

asListOrderedSet

public Set<T> asListOrderedSet()
Deprecated. 

asImmutableListOrderedSet

public Set<T> asImmutableListOrderedSet()
Deprecated. 

asSet

public Set<T> asSet()
Deprecated. 

asMutableSet

public Set<T> asMutableSet()
Deprecated. 

asTreeSet

public SortedSet<T> asTreeSet()
Deprecated. 

asSortedSet

public SortedSet<T> asSortedSet()
Deprecated. 
Return a SortedSet of the elements of this builder in their natural order. Note, will throw an exception if the elements are not comparable.

Returns:
an immutable sorted set.
Throws:
ClassCastException - if the elements do not implement Comparable.

asSortedSet

public SortedSet<T> asSortedSet(Comparator<? super T> comparator)
Deprecated. 

asMutableSortedSet

public SortedSet<T> asMutableSortedSet()
Deprecated. 

asEnclosedIterable

public EnclosedIterable<T> asEnclosedIterable()
Deprecated. 


Copyright © 2002-2014 Atlassian. All Rights Reserved.