Interface EntityHandler


  • public interface EntityHandler
    Globals Handler to access MasterEntities
    Since:
    10.0.16
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      <T extends MasterEntity>
      T
      get​(java.lang.Class<T> masterEntityClass, java.lang.Long id)
      Returns the instance of the MasterEntity with the matching id.
      <T extends MasterEntity>
      T
      get​(java.lang.Class<T> masterEntityClass, java.util.function.Predicate<T> p)
      Returns the instance of the MasterEntity with the matching predicate.
      <T extends MasterEntity>
      java.util.List<T>
      get​(java.lang.Class<T> masterEntityClass, java.util.function.Predicate<T> p, java.util.Comparator<? super T> sortComparator)
      Returns a list of the instances of the MasterEntities with the matching predicate, or all, if no predicate is provided.
      default <T extends MasterEntity>
      java.util.List<T>
      getEntities​(java.lang.Class<T> masterEntityClass)
      Returns a list of the not deleted instances of the MasterEntities.
    • Method Detail

      • get

        <T extends MasterEntity> T get​(java.lang.Class<T> masterEntityClass,
                                       java.lang.Long id)
        Returns the instance of the MasterEntity with the matching id.
        Type Parameters:
        T - the type of the master entity
        Parameters:
        masterEntityClass - the interface representing the MasterEntity
        id - the id of the entity to be returned
        Returns:
        the entity
        Since:
        10.0.16
      • get

        <T extends MasterEntity> T get​(java.lang.Class<T> masterEntityClass,
                                       java.util.function.Predicate<T> p)
        Returns the instance of the MasterEntity with the matching predicate.
        Type Parameters:
        T - the type of the master entity
        Parameters:
        masterEntityClass - the interface representing the MasterEntity.
        p - the predicate to match
        Returns:
        the entity
        Since:
        10.0.16
      • get

        <T extends MasterEntity> java.util.List<T> get​(java.lang.Class<T> masterEntityClass,
                                                       java.util.function.Predicate<T> p,
                                                       java.util.Comparator<? super T> sortComparator)
        Returns a list of the instances of the MasterEntities with the matching predicate, or all, if no predicate is provided.
        Type Parameters:
        T - the type of the master entity
        Parameters:
        masterEntityClass - the interface representing the MasterEntity.
        p - the predicate to match
        sortComparator - the comparator for sorting
        Returns:
        the list of matching entities
        Since:
        10.0.16
      • getEntities

        default <T extends MasterEntity> java.util.List<T> getEntities​(java.lang.Class<T> masterEntityClass)
        Returns a list of the not deleted instances of the MasterEntities.
        Type Parameters:
        T - the type of the master entity
        Parameters:
        masterEntityClass - the interface representing the MasterEntity.
        Returns:
        the list of matching, not deleted entities
        Since:
        10.0.108