Package io.jmix.core

Class Ids<T>

Type Parameters:
T - type of entity
All Implemented Interfaces:
Serializable, Cloneable, Iterable<Id<T>>, Collection<Id<T>>, List<Id<T>>, RandomAccess

public final class Ids<T> extends ArrayList<Id<T>>
Helper class which represent a collection of Id
See Also:
  • Constructor Details

    • Ids

      public Ids()
  • Method Details

    • of

      public static <T> Ids<T> of(Collection<T> entities)
      Type Parameters:
      T - entity type
      Parameters:
      entities - entity instances
      Returns:
      list of ids of the passed entities
    • of

      public static <T> Ids<T> of(Class<T> entityClass, Collection values)
      Type Parameters:
      T - entity type
      Parameters:
      entityClass - entity class
      values - id values
      Returns:
      list of ids of the passed entities
    • getValues

      public List getValues()
      Extract ids of entities from List<Id<T, K>>.
      Returns:
      list of id values
    • getValues

      public static <T> List getValues(List<Id<T>> ids)
      Extract ids of entities from List<Id<T, K>>.
      Type Parameters:
      T - type of entity
      Parameters:
      ids - list of ids
      Returns:
      list of entity keys