public class NamedAssociationWrapper extends Object implements NamedAssociation<Object>
Modifier and Type | Field and Description |
---|---|
protected NamedAssociation<Object> |
next |
Constructor and Description |
---|
NamedAssociationWrapper(NamedAssociation<Object> next) |
Modifier and Type | Method and Description |
---|---|
boolean |
containsName(String name)
Checks if there is an association with the given name.
|
int |
count() |
boolean |
equals(Object obj) |
Object |
get(String name)
Retrieves a named association.
|
int |
hashCode() |
Iterator<String> |
iterator() |
String |
nameOf(Object entity)
Checks if the entity is present.
|
NamedAssociation<Object> |
next() |
boolean |
put(String name,
Object entity)
Adds a named assocation.
|
EntityReference |
referenceOf(String name)
Returns the EntityReference for the Association with the given name.
|
Iterable<EntityReference> |
references()
Returns an unmodifiable Iterable of the references to the associated entities.
|
boolean |
remove(String name)
Remove a named association.
|
Map<String,Object> |
toMap() |
String |
toString() |
protected NamedAssociation<Object> next
public NamedAssociationWrapper(NamedAssociation<Object> next)
public NamedAssociation<Object> next()
public int count()
count
in interface NamedAssociation<Object>
public boolean containsName(String name)
NamedAssociation
containsName
in interface NamedAssociation<Object>
name
- The name of the association we are checking if it exists.public boolean put(String name, Object entity)
NamedAssociation
put
in interface NamedAssociation<Object>
name
- The name of the association.entity
- The entity for this named association.public boolean remove(String name)
NamedAssociation
remove
in interface NamedAssociation<Object>
name
- The name of the association.public Object get(String name)
NamedAssociation
get
in interface NamedAssociation<Object>
name
- The name of the association.public String nameOf(Object entity)
NamedAssociation
nameOf
in interface NamedAssociation<Object>
entity
- The entity to look for.public Map<String,Object> toMap()
toMap
in interface NamedAssociation<Object>
public Iterable<EntityReference> references()
NamedAssociation
references
in interface NamedAssociation<Object>
public EntityReference referenceOf(String name)
NamedAssociation
referenceOf
in interface NamedAssociation<Object>
name
- The name of the association to return the EntityReference for