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

    Modifier and Type
    Method
    Description
    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.
    static <K extends IEntity>
    boolean
    same(K e1, K e2)
    Return true if both entities are not null and have the same id.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Id

      public Id()
  • Method Details

    • 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 test
      e2 - 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 entities
      entity - the entity to test
      Returns:
      true if the list of entities contains the specified entity based on matching id values