Class Id


  • public class Id
    extends Object
    Provides an entity ID utility methods.
    Since:
    17.10.0
    • Constructor Detail

      • Id

        public 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 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