Package org.midheaven.lang
Class HashCode
java.lang.Object
org.midheaven.lang.HashCode
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic HashCode.CompositionCreates and returns an asymmetricHashCode.Compositionso the order of the values is relevantstatic intof(@org.midheaven.lang.NotNullable boolean[] array) Creates an instance from the provided value.static intof(@org.midheaven.lang.NotNullable byte[] array) Creates an instance from the provided value.static intof(@org.midheaven.lang.NotNullable char[] array) Creates an instance from the provided value.static intof(@org.midheaven.lang.NotNullable double[] array) Creates an instance from the provided value.static intof(@org.midheaven.lang.NotNullable float[] array) Creates an instance from the provided value.static intof(@org.midheaven.lang.NotNullable int[] array) Creates an instance from the provided value.static intof(@org.midheaven.lang.NotNullable long[] array) Creates an instance from the provided value.static intof(@org.midheaven.lang.NotNullable short[] array) Creates an instance from the provided value.static intof(boolean value) Creates an instance from the provided value.static intof(double value) Creates an instance from the provided value.static intof(float value) Creates an instance from the provided value.static intof(int value) Creates an instance from the provided value.static intof(long value) Creates an instance from the provided value.static <T> intof(T[] array) Creates an instance from the provided value.static intCreates an instance from the provided value.static HashCode.CompositionCreates and returns a symmetricHashCode.Compositionso the order of the values is not relevant
-
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
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
Creates and returns a symmetricHashCode.Compositionso the order of the values is not relevant- Returns:
- a symmetric
HashCode.Composition
-
asymmetric
Creates and returns an asymmetricHashCode.Compositionso the order of the values is relevant- Returns:
- an asymmetric
HashCode.Composition
-