T
- the type of objects that shall be identifiedpublic abstract class IdentifiersBase<T> extends Object
Modifier and Type | Field and Description |
---|---|
protected Map<T,String> |
ids
maps objects to identifiers
|
protected Map<String,T> |
objects
maps identifiers to objects
|
Modifier | Constructor and Description |
---|---|
protected |
IdentifiersBase(boolean useEquals) |
Modifier and Type | Method and Description |
---|---|
String |
fetchId(T object)
Get the id of the given object if it has an Id.
|
String |
getId(T object)
Get the id of the given object.
|
Set<String> |
getIds()
Get the ids of all objects
|
T |
getObject(String id)
Get the object with the given id
|
Set<T> |
getObjects()
Get the set of objects
|
protected void |
putObjectIdentifier(T object,
String id)
puts a object-identifier pair into the maps, no checks or what.
|
protected IdentifiersBase(boolean useEquals)
useEquals
- whether to use equality or object identity as identifier
scopeprotected void putObjectIdentifier(T object, String id)
object
- the objectid
- the identifierpublic String getId(T object)
object
- the objectpublic String fetchId(T object)
object
- the objectpublic final T getObject(String id)
id
- the idpublic final Set<T> getObjects()
Build 2013-10-07_11-27-38
Revision 99b27713a799a59a21b0b166eaaea8aaefbf125a