public class KeyedObjectMapBuilder<T> extends Object
Builder for keyed object maps.
Constructor and Description |
---|
KeyedObjectMapBuilder(KeyExtractor<? super T> ex) |
Modifier and Type | Method and Description |
---|---|
KeyedObjectMapBuilder<T> |
add(T... items) |
KeyedObjectMapBuilder<T> |
add(T item) |
KeyedObjectMapBuilder<T> |
addAll(Iterable<? extends T> items) |
KeyedObjectMap<T> |
build() |
boolean |
containsKey(long key)
Query whether an object with the specified key has been added.
|
Collection<T> |
objects()
Get the objects that have been added so far.
|
public KeyedObjectMapBuilder(KeyExtractor<? super T> ex)
public KeyedObjectMapBuilder<T> add(T item)
public KeyedObjectMapBuilder<T> addAll(Iterable<? extends T> items)
public KeyedObjectMapBuilder<T> add(T... items)
public Collection<T> objects()
Get the objects that have been added so far. Useful for re-processing them before finalizing the builder.
public boolean containsKey(long key)
Query whether an object with the specified key has been added.
key
- The key to query.true
if an object with key key
has been added.public KeyedObjectMap<T> build()