Class CollectionsWrappers

java.lang.Object
com.cedarsoftware.util.convert.CollectionsWrappers

public final class CollectionsWrappers extends Object
Provides cached access to common wrapper collection types (unmodifiable, synchronized, empty, checked). All wrapper instances are pre-initialized in a static block and stored in a cache for reuse to improve memory efficiency.

All collections are created empty and stored in a static cache. Wrapper collections are immutable and safe for concurrent access across threads.

Provides wrapper types for:

  • Unmodifiable collections (Collection, List, Set, SortedSet, NavigableSet)
  • Synchronized collections (Collection, List, Set, SortedSet, NavigableSet)
  • Empty collections (Collection, List, Set, SortedSet, NavigableSet)
  • Checked collections (Collection, List, Set, SortedSet, NavigableSet)
Author:
John DeRegnaucourt ([email protected]) Kenny Partlow ([email protected])
Copyright (c) Cedar Software LLC

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

License

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

    • getUnmodifiableCollectionClass

      public static <E> Class<Collection<E>> getUnmodifiableCollectionClass()
    • getUnmodifiableListClass

      public static <E> Class<List<E>> getUnmodifiableListClass()
    • getUnmodifiableSetClass

      public static <E> Class<Set<E>> getUnmodifiableSetClass()
    • getUnmodifiableSortedSetClass

      public static <E> Class<SortedSet<E>> getUnmodifiableSortedSetClass()
    • getUnmodifiableNavigableSetClass

      public static <E> Class<NavigableSet<E>> getUnmodifiableNavigableSetClass()
    • getSynchronizedCollectionClass

      public static <E> Class<Collection<E>> getSynchronizedCollectionClass()
    • getSynchronizedListClass

      public static <E> Class<List<E>> getSynchronizedListClass()
    • getSynchronizedSetClass

      public static <E> Class<Set<E>> getSynchronizedSetClass()
    • getSynchronizedSortedSetClass

      public static <E> Class<SortedSet<E>> getSynchronizedSortedSetClass()
    • getSynchronizedNavigableSetClass

      public static <E> Class<NavigableSet<E>> getSynchronizedNavigableSetClass()
    • getEmptyCollectionClass

      public static <E> Class<Collection<E>> getEmptyCollectionClass()
    • getEmptyListClass

      public static <E> Class<List<E>> getEmptyListClass()
    • getEmptySetClass

      public static <E> Class<Set<E>> getEmptySetClass()
    • getEmptySortedSetClass

      public static <E> Class<SortedSet<E>> getEmptySortedSetClass()
    • getEmptyNavigableSetClass

      public static <E> Class<NavigableSet<E>> getEmptyNavigableSetClass()
    • getCheckedCollectionClass

      public static <E> Class<Collection<E>> getCheckedCollectionClass()
    • getCheckedListClass

      public static <E> Class<List<E>> getCheckedListClass()
    • getCheckedSetClass

      public static <E> Class<Set<E>> getCheckedSetClass()
    • getCheckedSortedSetClass

      public static <E> Class<SortedSet<E>> getCheckedSortedSetClass()
    • getCheckedNavigableSetClass

      public static <E> Class<NavigableSet<E>> getCheckedNavigableSetClass()