A comprehensive collections framework API for Java providing interfaces for object collections, primitive collections and lazy iterables
npx @tessl/cli install tessl/maven-org-eclipse-collections--eclipse-collections-api@13.0.0Eclipse Collections is a comprehensive collections framework for Java that provides interfaces for object collections, primitive collections, and lazy iterables. This API module defines 238 interfaces for a rich set of collection types with extensive functional programming capabilities.
Maven:
<dependency>
<groupId>org.eclipse.collections</groupId>
<artifactId>eclipse-collections-api</artifactId>
<version>13.0.0</version>
</dependency>Gradle:
implementation 'org.eclipse.collections:eclipse-collections-api:13.0.0'Base Package: org.eclipse.collections.api
// Core collection interfaces
import org.eclipse.collections.api.RichIterable;
import org.eclipse.collections.api.LazyIterable;
import org.eclipse.collections.api.ParallelIterable;
// List collections
import org.eclipse.collections.api.list.ListIterable;
import org.eclipse.collections.api.list.MutableList;
import org.eclipse.collections.api.list.ImmutableList;
// Set collections
import org.eclipse.collections.api.set.SetIterable;
import org.eclipse.collections.api.set.MutableSet;
import org.eclipse.collections.api.set.ImmutableSet;
// Map collections
import org.eclipse.collections.api.map.MapIterable;
import org.eclipse.collections.api.map.MutableMap;
import org.eclipse.collections.api.map.ImmutableMap;
// Factory classes
import org.eclipse.collections.api.factory.Lists;
import org.eclipse.collections.api.factory.Sets;
import org.eclipse.collections.api.factory.Maps;
// Functional interfaces
import org.eclipse.collections.api.block.function.Function;
import org.eclipse.collections.api.block.predicate.Predicate;
import org.eclipse.collections.api.block.procedure.Procedure;
// Ordering interfaces
import org.eclipse.collections.api.ordered.OrderedIterable;
import org.eclipse.collections.api.ordered.ReversibleIterable;
import org.eclipse.collections.api.ordered.SortedIterable;
// Tuple interfaces
import org.eclipse.collections.api.tuple.Pair;
import org.eclipse.collections.api.tuple.Triple;
import org.eclipse.collections.api.tuple.Twin;
import org.eclipse.collections.api.tuple.Triplet;
// Partition interface
import org.eclipse.collections.api.partition.PartitionIterable;// Create mutable collections
MutableList<String> list = Lists.mutable.with("a", "b", "c");
MutableSet<Integer> set = Sets.mutable.with(1, 2, 3);
MutableMap<String, Integer> map = Maps.mutable.with("key1", 1, "key2", 2);
// Create immutable collections
ImmutableList<String> immutableList = Lists.immutable.with("a", "b", "c");
ImmutableSet<Integer> immutableSet = Sets.immutable.with(1, 2, 3);
ImmutableMap<String, Integer> immutableMap = Maps.immutable.with("key1", 1, "key2", 2);// Using RichIterable functional methods
RichIterable<String> names = Lists.mutable.with("John", "Jane", "Bob");
// Filter elements
RichIterable<String> filtered = names.select(name -> name.startsWith("J"));
// Transform elements
RichIterable<Integer> lengths = names.collect(String::length);
// Find elements
String found = names.detect(name -> name.contains("o"));
// Partition elements
PartitionIterable<String> partition = names.partition(name -> name.length() > 3);Comprehensive collection interfaces including Lists, Sets, Bags, and Stacks with both mutable and immutable variants, including sorted collections.
// List operations
ListIterable<T> extends RichIterable<T>
MutableList<T> extends MutableCollection<T>, List<T>, ListIterable<T>
ImmutableList<T> extends ListIterable<T>
// Set operations with mathematical functions
SetIterable<T> extends RichIterable<T>
MutableSet<T> extends MutableCollection<T>, Set<T>, SetIterable<T>
ImmutableSet<T> extends SetIterable<T>
// Sorted set operations
SortedSetIterable<T> extends SetIterable<T>, SortedIterable<T>
MutableSortedSet<T> extends MutableSet<T>, SortedSet<T>, SortedSetIterable<T>
ImmutableSortedSet<T> extends SortedSetIterable<T>
// Bag operations (multiset with occurrence counting)
Bag<T> extends RichIterable<T>
MutableBag<T> extends MutableBagIterable<T>, Bag<T>
ImmutableBag<T> extends Bag<T>
// Sorted bag operations
SortedBag<T> extends Bag<T>, SortedIterable<T>
MutableSortedBag<T> extends MutableBag<T>, SortedBag<T>
ImmutableSortedBag<T> extends SortedBag<T>
// Stack operations (LIFO collections)
StackIterable<T> extends OrderedIterable<T>
MutableStack<T> extends MutableCollection<T>, StackIterable<T>
ImmutableStack<T> extends StackIterable<T>Advanced key-value collections including traditional maps, sorted maps, multimaps for one-to-many relationships, and bidirectional maps.
// Map operations with rich functional programming
MapIterable<K,V>
MutableMap<K,V> extends Map<K,V>, MapIterable<K,V>
ImmutableMap<K,V> extends MapIterable<K,V>
// Sorted map operations
SortedMapIterable<K,V> extends MapIterable<K,V>
MutableSortedMap<K,V> extends MutableMap<K,V>, SortedMap<K,V>, SortedMapIterable<K,V>
ImmutableSortedMap<K,V> extends SortedMapIterable<K,V>
// One-to-many key-value associations
Multimap<K,V>
MutableMultimap<K,V> extends Multimap<K,V>
ImmutableMultimap<K,V> extends Multimap<K,V>
// Bidirectional one-to-one mapping
BiMap<K,V> extends MapIterable<K,V>
MutableBiMap<K,V> extends BiMap<K,V>, MutableMap<K,V>
ImmutableBiMap<K,V> extends BiMap<K,V>, ImmutableMap<K,V>Memory-efficient primitive collections for all 8 Java primitive types, avoiding boxing overhead.
// Primitive iterables (base interfaces)
BooleanIterable, ByteIterable, CharIterable, DoubleIterable
FloatIterable, IntIterable, LongIterable, ShortIterable
// Primitive collections (example with int)
MutableIntList extends IntIterable
ImmutableIntList extends IntIterable
MutableIntSet extends IntIterable
IntIntMap // primitive-to-primitive maps
ObjectIntMap<K> // object-to-primitive maps
IntObjectMap<V> // primitive-to-object mapsRich functional programming support with Functions, Predicates, and Procedures for both object and primitive types.
// Core functional interfaces
Function<T,V> extends java.util.function.Function<T,V>
Function2<T1,T2,V>
Function0<V>
Predicate<T> extends java.util.function.Predicate<T>
Predicate2<T,P>
Procedure<T>
Procedure2<T,P>
// Primitive function interfaces
IntFunction<T>
IntToObjectFunction<V>
IntToIntFunction
ObjectIntPredicate<T>
IntProcedureMemory-efficient lazy evaluation and parallel processing capabilities for high-performance operations.
// Lazy evaluation for deferred computation
LazyIterable<T> extends RichIterable<T>
// Parallel processing with thread-safe operations
ParallelIterable<T>Base interfaces providing ordering and sorting capabilities across all collection types.
// Base ordering interfaces
OrderedIterable<T> extends RichIterable<T>
ReversibleIterable<T> extends OrderedIterable<T>
SortedIterable<T> extends OrderedIterable<T>Tuple types for grouping related values with compile-time type safety.
// Core tuple interfaces
Pair<T1, T2> extends Serializable, Comparable<Pair<T1, T2>>
Triple<T1, T2, T3> extends Serializable, Comparable<Triple<T1, T2, T3>>
Twin<T> extends Pair<T, T>
Triplet<T> extends Triple<T, T, T>Factory classes and utility interfaces for convenient collection creation and manipulation.
// Static factory classes
Lists.mutable, Lists.immutable, Lists.fixedSize
Sets.mutable, Sets.immutable, Sets.fixedSize
Maps.mutable, Maps.immutable, Maps.fixedSize
Bags.mutable, Bags.immutable
Stacks.mutable, Stacks.immutable
// Factory interfaces
MutableListFactory
ImmutableListFactory
MutableSetFactory
ImmutableSetFactoryEclipse Collections uses a consistent design pattern across all collection types: