public class EfficientReflectionHashCode extends Object implements org.apache.commons.lang3.builder.Builder<Integer>
HashCodeBuilder.reflectionHashCode(Object, boolean).
Extracts the fields of the classes to hash via the ReflectionAwareComparable class when possible.| Constructor and Description |
|---|
EfficientReflectionHashCode() |
| Modifier and Type | Method and Description |
|---|---|
EfficientReflectionHashCode |
append(boolean value)
Append a
hashCode for a boolean. |
EfficientReflectionHashCode |
append(byte value)
Append a
hashCode for a byte. |
EfficientReflectionHashCode |
append(char value)
Append a
hashCode for a char. |
EfficientReflectionHashCode |
append(double value)
Append a
hashCode for a double. |
EfficientReflectionHashCode |
append(float value)
Append a
hashCode for a float. |
EfficientReflectionHashCode |
append(int value)
Append a
hashCode for an int. |
EfficientReflectionHashCode |
append(long value)
Append a
hashCode for a long. |
EfficientReflectionHashCode |
append(Object object)
Append a
hashCode for an Object. |
EfficientReflectionHashCode |
append(short value)
Append a
hashCode for a short. |
Integer |
build()
Returns the computed
hashCode. |
static int |
reflectionHashCode(ReflectionAwareComparable object) |
public static int reflectionHashCode(ReflectionAwareComparable object)
public EfficientReflectionHashCode append(boolean value)
Append a hashCode for a boolean.
This adds 1 when true, and 0 when false to the hashCode.
This is in contrast to the standard java.lang.Boolean.hashCode handling, which computes a hashCode value of
1231 for java.lang.Boolean instances that represent true or 1237 for
java.lang.Boolean instances that represent false.
This is in accordance with the Effective Java design.
value - the boolean to add to the hashCodepublic EfficientReflectionHashCode append(byte value)
Append a hashCode for a byte.
value - the byte to add to the hashCodepublic EfficientReflectionHashCode append(char value)
Append a hashCode for a char.
value - the char to add to the hashCodepublic EfficientReflectionHashCode append(double value)
Append a hashCode for a double.
value - the double to add to the hashCodepublic EfficientReflectionHashCode append(float value)
Append a hashCode for a float.
value - the float to add to the hashCodepublic EfficientReflectionHashCode append(int value)
Append a hashCode for an int.
value - the int to add to the hashCodepublic EfficientReflectionHashCode append(long value)
Append a hashCode for a long.
value - the long to add to the hashCodepublic EfficientReflectionHashCode append(Object object)
Append a hashCode for an Object.
object - the Object to add to the hashCodepublic EfficientReflectionHashCode append(short value)
Append a hashCode for a short.
value - the short to add to the hashCodeCopyright © 2024 MuleSoft, Inc.. All rights reserved.