T
- Parameterized associatee typepublic interface NamedAssociation<T> extends Iterable<String>, AbstractAssociation
This works similar to a Map with a String key.
The Iterable<String> returns the names in the association set. The order during iteration is random by definition, even if other behaviors can possibly be observed. The depends on the underlying entity store implementation.
Modifier and Type | Method and Description |
---|---|
boolean |
clear()
Clear all named associations.
|
boolean |
containsName(String name)
Checks if there is an association with the given name.
|
int |
count() |
T |
get(String name)
Retrieves a named association.
|
String |
nameOf(T entity)
Checks if the entity is present.
|
boolean |
put(String name,
T entity)
Adds a named association.
|
EntityReference |
referenceOf(String name)
Returns the EntityReference for the Association with the given name.
|
Stream<Map.Entry<String,EntityReference>> |
references()
Returns a stream of the references to the associated entities.
|
boolean |
remove(String name)
Remove a named association.
|
Map<String,T> |
toMap() |
forEach, iterator, spliterator
int count()
boolean containsName(String name)
name
- The name of the association we are checking if it exists.boolean put(String name, T entity)
name
- The name of the association.entity
- The entity for this named association.boolean remove(String name)
name
- The name of the association.boolean clear()
T get(String name)
name
- The name of the association.String nameOf(T entity)
entity
- The entity to look for.Map<String,T> toMap()
Stream<Map.Entry<String,EntityReference>> references()
EntityReference referenceOf(String name)
name
- The name of the association to return the EntityReference for