Class HashCode

java.lang.Object
org.midheaven.lang.HashCode

public class HashCode extends Object
Simplifies hashCode calculations. For primitives and arrays this class delegates to the hashCode static methods present in the respective wrappers of Arrays class
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates and returns an asymmetric HashCode.Composition so the order of the values is relevant
    static int
    of(@org.midheaven.lang.NotNullable boolean[] array)
    Creates an instance from the provided value.
    static int
    of(@org.midheaven.lang.NotNullable byte[] array)
    Creates an instance from the provided value.
    static int
    of(@org.midheaven.lang.NotNullable char[] array)
    Creates an instance from the provided value.
    static int
    of(@org.midheaven.lang.NotNullable double[] array)
    Creates an instance from the provided value.
    static int
    of(@org.midheaven.lang.NotNullable float[] array)
    Creates an instance from the provided value.
    static int
    of(@org.midheaven.lang.NotNullable int[] array)
    Creates an instance from the provided value.
    static int
    of(@org.midheaven.lang.NotNullable long[] array)
    Creates an instance from the provided value.
    static int
    of(@org.midheaven.lang.NotNullable short[] array)
    Creates an instance from the provided value.
    static int
    of(boolean value)
    Creates an instance from the provided value.
    static int
    of(double value)
    Creates an instance from the provided value.
    static int
    of(float value)
    Creates an instance from the provided value.
    static int
    of(int value)
    Creates an instance from the provided value.
    static int
    of(long value)
    Creates an instance from the provided value.
    static <T> int
    of(T[] array)
    Creates an instance from the provided value.
    static int
    of(Object value)
    Creates an instance from the provided value.
    Creates and returns a symmetric HashCode.Composition so the order of the values is not relevant

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • of

      public static int of(int value)
      Creates an instance from the provided value.
      Parameters:
      value - the value value
      Returns:
      the result of of
    • of

      public static int of(long value)
      Creates an instance from the provided value.
      Parameters:
      value - the value value
      Returns:
      the result of of
    • of

      public static int of(double value)
      Creates an instance from the provided value.
      Parameters:
      value - the value value
      Returns:
      the result of of
    • of

      public static int of(float value)
      Creates an instance from the provided value.
      Parameters:
      value - the value value
      Returns:
      the result of of
    • of

      public static int of(boolean value)
      Creates an instance from the provided value.
      Parameters:
      value - the value value
      Returns:
      the result of of
    • of

      public static int of(Object value)
      Creates an instance from the provided value.
      Parameters:
      value - the value value
      Returns:
      the result of of
    • of

      public static <T> int of(T[] array)
      Creates an instance from the provided value.
      Parameters:
      array - the array value
      Returns:
      the result of of
    • of

      public static int of(@org.midheaven.lang.NotNullable byte[] array)
      Creates an instance from the provided value.
      Parameters:
      array - the array value
      Returns:
      the result of of
    • of

      public static int of(@org.midheaven.lang.NotNullable short[] array)
      Creates an instance from the provided value.
      Parameters:
      array - the array value
      Returns:
      the result of of
    • of

      public static int of(@org.midheaven.lang.NotNullable char[] array)
      Creates an instance from the provided value.
      Parameters:
      array - the array value
      Returns:
      the result of of
    • of

      public static int of(@org.midheaven.lang.NotNullable int[] array)
      Creates an instance from the provided value.
      Parameters:
      array - the array value
      Returns:
      the result of of
    • of

      public static int of(@org.midheaven.lang.NotNullable long[] array)
      Creates an instance from the provided value.
      Parameters:
      array - the array value
      Returns:
      the result of of
    • of

      public static int of(@org.midheaven.lang.NotNullable float[] array)
      Creates an instance from the provided value.
      Parameters:
      array - the array value
      Returns:
      the result of of
    • of

      public static int of(@org.midheaven.lang.NotNullable double[] array)
      Creates an instance from the provided value.
      Parameters:
      array - the array value
      Returns:
      the result of of
    • of

      public static int of(@org.midheaven.lang.NotNullable boolean[] array)
      Creates an instance from the provided value.
      Parameters:
      array - the array value
      Returns:
      the result of of
    • symmetric

      public static HashCode.Composition symmetric()
      Creates and returns a symmetric HashCode.Composition so the order of the values is not relevant
      Returns:
      a symmetric HashCode.Composition
    • asymmetric

      public static HashCode.Composition asymmetric()
      Creates and returns an asymmetric HashCode.Composition so the order of the values is relevant
      Returns:
      an asymmetric HashCode.Composition