Interface AuthorIdIndex<T>
-
- Type Parameters:
T
- The type of the object to be indexed.
@API(type=NOT_EXTENDABLE, src=PUBLIC) public interface AuthorIdIndex<T>
An index that maps from IDs to objects and viceversa.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description long
getId(T object)
Get the id of the given object or a fresh one if none is assigned already.java.lang.Long
getIdIfExists(T object)
Get the id of the given object, ornull
if the object was not assigned an ID.T
getObjectById(long id)
Returns the object with a specified id or null if none exists.
-
-
-
Method Detail
-
getObjectById
T getObjectById(long id)
Returns the object with a specified id or null if none exists.- Parameters:
id
- the id.- Returns:
- the object with the specified id.
-
getId
long getId(T object)
Get the id of the given object or a fresh one if none is assigned already. If this index has not assigned an id already to the given object, a unique id is assigned and returned.- Parameters:
object
- The object.- Returns:
- the id associated with the object.
-
getIdIfExists
java.lang.Long getIdIfExists(T object)
Get the id of the given object, ornull
if the object was not assigned an ID.- Parameters:
object
- The object.- Returns:
- the id associated with the object, or null if the ID does not exist.
-
-