Class CollectionBuilder<T>

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

@Deprecated @NotThreadSafe public final class CollectionBuilder<T> extends Object
Deprecated.
since 10.0, use Java built-in utilities or specialised libraries
Convenience class for creating collections (Set and List) instances or enclosed iterables.

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

  • Method Details

    • 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.