public abstract class EntityCollectionBuilder
extends java.lang.Object
Created by MichaelEkstrand on 4/18/2017.
Constructor and Description |
---|
EntityCollectionBuilder() |
Modifier and Type | Method and Description |
---|---|
EntityCollectionBuilder |
add(Entity e)
Add an entity to the collection.
|
abstract EntityCollectionBuilder |
add(Entity e,
boolean replace)
Add an entity to the collection.
|
abstract EntityCollectionBuilder |
addIndex(java.lang.String attrName)
Add an index to an entity collection to speed up lookups.
|
abstract <T> EntityCollectionBuilder |
addIndex(TypedName<T> attribute)
Add an index to an entity collection to speed up lookups.
|
abstract EntityCollection |
build()
Build the entity collection.
|
abstract java.lang.Iterable<Entity> |
entities()
Get a view of the entities added, for iteration and re-processing.
|
public abstract <T> EntityCollectionBuilder addIndex(TypedName<T> attribute)
Add an index to an entity collection to speed up lookups.
attribute
- The attribute to index.T
- The attribute typepublic abstract EntityCollectionBuilder addIndex(java.lang.String attrName)
Add an index to an entity collection to speed up lookups.
attrName
- The name of the attribute to index.public EntityCollectionBuilder add(Entity e)
Add an entity to the collection. If an entity with the specified ID already exists, it is replaced.
e
- The entity to add.public abstract EntityCollectionBuilder add(Entity e, boolean replace)
Add an entity to the collection.
e
- The entity to add.replace
- Whether to replace. If false
, and an entity with the same ID as e
has already been added, this entity is silently ignored.public abstract java.lang.Iterable<Entity> entities()
Get a view of the entities added, for iteration and re-processing.
public abstract EntityCollection build()
Build the entity collection.