Class HasIdentity.Utilities

java.lang.Object
com.mayam.wf.config.shared.HasIdentity.Utilities
Enclosing interface:
HasIdentity

public static class HasIdentity.Utilities extends Object
  • Field Details

  • Constructor Details

    • Utilities

      public Utilities()
  • Method Details

    • createUniqueId

      public static final String createUniqueId(String sourceId)
      Makes a unique identifier based on an existing identifier. Typically used when creating copies. A naive time based algorithm is used, but it should ensure uniqueness within a specific configuration since there is only ever one writer.
      Parameters:
      sourceId - identifier used as base.
      Returns:
      newly created unique identifier.
    • lookup

      public static <T extends HasIdentity> T lookup(String id, Collection<T> entries)
      Looks up an object implementing HasIdentity by its identitfier within a collection.
    • identityList

      public static <T extends HasIdentity> List<String> identityList(Collection<T> entries)
      Extracts a list of identities from a collection of HasIdentity objects.
    • objectList

      public static <T extends HasIdentity> List<T> objectList(Collection<String> needles, Collection<T> haystack)
      Compiles a list that is a subset, selected using the provided identifiers, of a collection of HasIdentity objects.
    • identitySet

      public static <T extends HasIdentity> Set<String> identitySet(Collection<T> entries)
      Extracts a set of identities from a collection of HasIdentity objects.