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
Modifier and TypeMethodDescriptionlong
Get the id of the given object or a fresh one if none is assigned already.getIdIfExists
(T object) Get the id of the given object, ornull
if the object was not assigned an ID.getObjectById
(long id) Returns the object with a specified id or null if none exists.
-
Method Details
-
getObjectById
Returns the object with a specified id or null if none exists.- Parameters:
id
- the id.- Returns:
- the object with the specified id.
-
getId
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
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.
-