public class Entity extends Object
Modifier | Constructor and Description |
---|---|
protected |
Entity() |
protected |
Entity(int id) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o)
|
int |
getId()
Get the unique id of this entity.
|
int |
hashCode() |
static <T extends Entity> |
idMap(Collection<T> values)
Helper method to create a id-to-entity map from a collection of entities.
|
static <T extends Entity,L extends List<T>> |
sortById(L list)
Helper method to sort a list of entities by ascending id.
|
public int getId()
Map
s and for cross-referencing in XML files.public static <T extends Entity,L extends List<T>> L sortById(L list)
list
- a list of entities that will be sorted in-place.public static <T extends Entity> HashMap<Integer,T> idMap(Collection<T> values)
values
- a collection of entitiesCopyright © 2015–2021 Fiji. All rights reserved.