Class HashProviders

java.lang.Object
com.scurrilous.circe.HashProviders

public final class HashProviders extends Object
Static utility methods for discovering HashProvider instances.
  • Field Details

  • Method Details

    • iterator

      public static Iterator<HashProvider> iterator()
      Returns an iterator over all known HashProvider instances.
      Returns:
      an iterator over all HashProviders
    • best

      public static HashProvider best(HashParameters params)
      Returns the best hash provider supporting at least a stateful implementation of a hash function with the given parameters.
      Parameters:
      params - the parameters defining the hash function
      Returns:
      the best hash provider for the given parameters
      Throws:
      UnsupportedOperationException - if no provider supports the parameters
    • best

      public static HashProvider best(HashParameters params, EnumSet<HashSupport> required)
      Returns the best hash provider supporting at least the given flags for a hash function with the given parameters.
      Parameters:
      params - the parameters defining the hash function
      required - the required support flags for a provider to be considered
      Returns:
      the best hash provider for the given parameters
      Throws:
      UnsupportedOperationException - if no provider supports the parameters
    • search

      public static SortedMap<EnumSet<HashSupport>,HashProvider> search(HashParameters params)
      Returns a map of hash providers supporting at least a stateful implementation of a hash function with the given parameters.
      Parameters:
      params - the parameters defining the hash function
      Returns:
      a sorted map of hash support flags to hash providers
    • search

      public static SortedMap<EnumSet<HashSupport>,HashProvider> search(HashParameters params, EnumSet<HashSupport> required)
      Returns a map of hash providers supporting at least the given flags for a hash function with the given parameters.
      Parameters:
      params - the parameters defining the hash function
      required - the required support flags for a provider to be included
      Returns:
      a sorted map of hash support flags to hash providers