Class UniqueIdentifierCalculator

java.lang.Object
com.bluebell.greenhouse.radicle.util.UniqueIdentifierCalculator

public final class UniqueIdentifierCalculator extends Object
Service for handling computations regarding unique identifiers that are typical used on GenericDTOs.
Version:
3.0.6
Author:
Stephen Prizio
  • Method Details

    • generateUid

      public static String generateUid(GenericEntity entity)
      Generates the uid from the given GenericEntity.
      Parameters:
      entity - GenericEntity
      Returns:
      uid
    • generateUid

      public static String generateUid(Long id, Class<? extends GenericEntity> entityType)
      Generates the uid for a projected row, which carries an id but no entity.
      Parameters:
      id - entity id
      entityType - entity type the row was projected from
      Returns:
      uid
    • retrieveId

      public static long retrieveId(String uid)
      Retrieves the id for an entity from the given GenericDTO.
      Parameters:
      uid - unique identifier
      Returns:
      id
    • generateUniqueIdentifierAsLong

      public static long generateUniqueIdentifierAsLong(String uid)
      Generates a unique long from the given uid.
      Parameters:
      uid - unique identifier
      Returns:
      unique long
    • generateGenericUid

      public static String generateGenericUid(Object... values)
      Generates a generic uid from the given values.
      Parameters:
      values - uid values
      Returns:
      uid