Enum Class HashSupport

java.lang.Object
java.lang.Enum<HashSupport>
com.scurrilous.circe.HashSupport
All Implemented Interfaces:
Serializable, Comparable<HashSupport>, Constable

public enum HashSupport extends Enum<HashSupport>
Flags indicating the support available for some set of hash algorithm.
  • Enum Constant Details

  • Field Details

    • MIN_PRIORITY

      public static final int MIN_PRIORITY
      The minimum priority value, indicating the highest priority. All flags have a priority value greater than this.
      See Also:
    • MAX_PRIORITY

      public static final int MAX_PRIORITY
      The maximum priority value, indicating the lowest priority. All flags have a priority value less than this.
      See Also:
  • Method Details

    • values

      public static HashSupport[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static HashSupport valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getPriority

      public int getPriority()
      Returns the relative priority of a hash algorithm support flag, which is an indicator of its performance and flexibility. Lower values indicate higher priority.
      Returns:
      the priority of this flag (currently between 10 and 90)
    • getMaxPriority

      public static int getMaxPriority(EnumSet<HashSupport> set)
      Returns the priority of the highest-priority hash algorithm support flag in the given set of flags. If the set is empty, MAX_PRIORITY is returned.
      Parameters:
      set - a set of hash algorithm support flags
      Returns:
      the highest priority (lowest value) in the set, or MAX_PRIORITY if empty
    • compare

      public static int compare(EnumSet<HashSupport> set1, EnumSet<HashSupport> set2)
      Compares the given sets of hash algorithm support flags for priority order. The set with the highest priority flag without a flag of matching priority in the other set has higher priority.
      Parameters:
      set1 - the first set to be compared
      set2 - the second set to be compared
      Returns:
      a negative integer, zero, or a positive integer if the first set has priority higher than, equal to, or lower than the second