Class HashProviders


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

      Fields 
      Modifier and Type Field Description
      (package private) static java.util.Collection<HashProvider> ALL_PROVIDERS  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static HashProvider best​(HashParameters params)
      Returns the best hash provider supporting at least a stateful implementation of a hash function with the given parameters.
      static HashProvider best​(HashParameters params, java.util.EnumSet<HashSupport> required)
      Returns the best hash provider supporting at least the given flags for a hash function with the given parameters.
      static java.util.Iterator<HashProvider> iterator()
      Returns an iterator over all known HashProvider instances.
      static java.util.SortedMap<java.util.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.
      static java.util.SortedMap<java.util.EnumSet<HashSupport>,​HashProvider> search​(HashParameters params, java.util.EnumSet<HashSupport> required)
      Returns a map of hash providers supporting at least the given flags for a hash function with the given parameters.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • ALL_PROVIDERS

        static final java.util.Collection<HashProvider> ALL_PROVIDERS
    • Method Detail

      • iterator

        public static java.util.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:
        java.lang.UnsupportedOperationException - if no provider supports the parameters
      • best

        public static HashProvider best​(HashParameters params,
                                        java.util.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:
        java.lang.UnsupportedOperationException - if no provider supports the parameters
      • search

        public static java.util.SortedMap<java.util.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 java.util.SortedMap<java.util.EnumSet<HashSupport>,​HashProvider> search​(HashParameters params,
                                                                                                    java.util.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