Class TopiaEntities

java.lang.Object
org.nuiton.topia.persistence.TopiaEntities

public class TopiaEntities extends Object
Utility class that provides useful methods for TopiaEntity manipulation.
Since:
3.0
Author:
Brendan Le Ny : leny@codelutin.com, Arnaud Thimel (Code Lutin)
  • Constructor Details

    • TopiaEntities

      public TopiaEntities()
  • Method Details

    • entityHasId

      public static <E extends TopiaEntity> com.google.common.base.Predicate<E> entityHasId(String id)
      Creates a Guava's Predicate which tests if a TopiaEntity has the given topiaId
      Type Parameters:
      E - type of entity
      Parameters:
      id - the expected topiaId
      Returns:
      the created Predicate
    • findByTopiaId

      public static <E extends TopiaEntity> E findByTopiaId(Iterable<E> entities, String id)
      Iterate over the given Iterable looking for a TopiaEntity having the given topiaId.
      Type Parameters:
      E - the type of TopiaEntity of the given Iterable
      Parameters:
      entities - the Iterable instance to iterate through
      id - the expected topiaId
      Returns:
      the found TopiaEntity or null
    • getTopiaIdFunction

      public static <E extends TopiaEntity> com.google.common.base.Function<E,String> getTopiaIdFunction()
      Function to obtain TopiaEntity.getTopiaId() from any entity.
      Type Parameters:
      E - type of entity
      Returns:
      FIXME
      Since:
      2.6.12