Package com.avoka.core.entity
Class Id
- java.lang.Object
-
- com.avoka.core.entity.Id
-
public class Id extends Object
Provides an entity ID utility methods.- Since:
- 17.10.0
-
-
Constructor Summary
Constructors Constructor Description Id()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <K extends IEntity>
booleancontains(List<K> entityList, K entity)
Return true if the list of entities contains the specified entity based on matching id values.static <K extends IEntity>
booleansame(K e1, K e2)
Return true if both entities are not null and have the same id.
-
-
-
Method Detail
-
same
public static <K extends IEntity> boolean same(K e1, K e2)
Return true if both entities are not null and have the same id.- Parameters:
e1
- the first entity to teste2
- the second entity to test- Returns:
- true if both entities are not null and have the same id
- Throws:
IllegalArgumentException
- if different classes are tested for equality
-
contains
public static <K extends IEntity> boolean contains(List<K> entityList, K entity)
Return true if the list of entities contains the specified entity based on matching id values.- Parameters:
entityList
- list of entitiesentity
- the entity to test- Returns:
- true if the list of entities contains the specified entity based on matching id values
-
-