Class Objects
- java.lang.Object
-
- dev.paseto.jpaseto.lang.Objects
-
public final class Objects extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static inthashCode(boolean bool)Return the same value as.Boolean.hashCode()static inthashCode(double dbl)Return the same value as.Double.hashCode()static inthashCode(float flt)Return the same value as.Float.hashCode()static inthashCode(long lng)Return the same value as.Long.hashCode()static intnullSafeHashCode(boolean[] array)Return a hash code based on the contents of the specified array.static intnullSafeHashCode(byte[] array)Return a hash code based on the contents of the specified array.static intnullSafeHashCode(char[] array)Return a hash code based on the contents of the specified array.static intnullSafeHashCode(double[] array)Return a hash code based on the contents of the specified array.static intnullSafeHashCode(float[] array)Return a hash code based on the contents of the specified array.static intnullSafeHashCode(int[] array)Return a hash code based on the contents of the specified array.static intnullSafeHashCode(long[] array)Return a hash code based on the contents of the specified array.static intnullSafeHashCode(short[] array)Return a hash code based on the contents of the specified array.static intnullSafeHashCode(java.lang.Object obj)Return as hash code for the given object; typically the value of.Object.hashCode()static intnullSafeHashCode(java.lang.Object[] array)Return a hash code based on the contents of the specified array.static java.lang.StringnullSafeToString(boolean[] array)Return a String representation of the contents of the specified array.static java.lang.StringnullSafeToString(byte[] array)Return a String representation of the contents of the specified array.static java.lang.StringnullSafeToString(char[] array)Return a String representation of the contents of the specified array.static java.lang.StringnullSafeToString(double[] array)Return a String representation of the contents of the specified array.static java.lang.StringnullSafeToString(float[] array)Return a String representation of the contents of the specified array.static java.lang.StringnullSafeToString(int[] array)Return a String representation of the contents of the specified array.static java.lang.StringnullSafeToString(long[] array)Return a String representation of the contents of the specified array.static java.lang.StringnullSafeToString(short[] array)Return a String representation of the contents of the specified array.static java.lang.StringnullSafeToString(java.lang.Object obj)Return a String representation of the specified Object.static java.lang.StringnullSafeToString(java.lang.Object[] array)Return a String representation of the contents of the specified array.
-
-
-
Method Detail
-
nullSafeHashCode
public static int nullSafeHashCode(java.lang.Object obj)
Return as hash code for the given object; typically the value of. If the object is an array, this method will delegate to any of theObject.hashCode()nullSafeHashCodemethods for arrays in this class. If the object isnull, this method returns 0.
-
nullSafeHashCode
public static int nullSafeHashCode(java.lang.Object[] array)
Return a hash code based on the contents of the specified array. Ifarrayisnull, this method returns 0.
-
nullSafeHashCode
public static int nullSafeHashCode(boolean[] array)
Return a hash code based on the contents of the specified array. Ifarrayisnull, this method returns 0.
-
nullSafeHashCode
public static int nullSafeHashCode(byte[] array)
Return a hash code based on the contents of the specified array. Ifarrayisnull, this method returns 0.
-
nullSafeHashCode
public static int nullSafeHashCode(char[] array)
Return a hash code based on the contents of the specified array. Ifarrayisnull, this method returns 0.
-
nullSafeHashCode
public static int nullSafeHashCode(double[] array)
Return a hash code based on the contents of the specified array. Ifarrayisnull, this method returns 0.
-
nullSafeHashCode
public static int nullSafeHashCode(float[] array)
Return a hash code based on the contents of the specified array. Ifarrayisnull, this method returns 0.
-
nullSafeHashCode
public static int nullSafeHashCode(int[] array)
Return a hash code based on the contents of the specified array. Ifarrayisnull, this method returns 0.
-
nullSafeHashCode
public static int nullSafeHashCode(long[] array)
Return a hash code based on the contents of the specified array. Ifarrayisnull, this method returns 0.
-
nullSafeHashCode
public static int nullSafeHashCode(short[] array)
Return a hash code based on the contents of the specified array. Ifarrayisnull, this method returns 0.
-
hashCode
public static int hashCode(boolean bool)
Return the same value as.Boolean.hashCode()- See Also:
Boolean.hashCode()
-
hashCode
public static int hashCode(double dbl)
Return the same value as.Double.hashCode()- See Also:
Double.hashCode()
-
hashCode
public static int hashCode(float flt)
Return the same value as.Float.hashCode()- See Also:
Float.hashCode()
-
hashCode
public static int hashCode(long lng)
Return the same value as.Long.hashCode()- See Also:
Long.hashCode()
-
nullSafeToString
public static java.lang.String nullSafeToString(java.lang.Object obj)
Return a String representation of the specified Object.Builds a String representation of the contents in case of an array. Returns
"null"ifobjisnull.- Parameters:
obj- the object to build a String representation for- Returns:
- a String representation of
obj
-
nullSafeToString
public static java.lang.String nullSafeToString(java.lang.Object[] array)
Return a String representation of the contents of the specified array.The String representation consists of a list of the array's elements, enclosed in curly braces (
"{}"). Adjacent elements are separated by the characters", "(a comma followed by a space). Returns"null"ifarrayisnull.- Parameters:
array- the array to build a String representation for- Returns:
- a String representation of
array
-
nullSafeToString
public static java.lang.String nullSafeToString(boolean[] array)
Return a String representation of the contents of the specified array.The String representation consists of a list of the array's elements, enclosed in curly braces (
"{}"). Adjacent elements are separated by the characters", "(a comma followed by a space). Returns"null"ifarrayisnull.- Parameters:
array- the array to build a String representation for- Returns:
- a String representation of
array
-
nullSafeToString
public static java.lang.String nullSafeToString(byte[] array)
Return a String representation of the contents of the specified array.The String representation consists of a list of the array's elements, enclosed in curly braces (
"{}"). Adjacent elements are separated by the characters", "(a comma followed by a space). Returns"null"ifarrayisnull.- Parameters:
array- the array to build a String representation for- Returns:
- a String representation of
array
-
nullSafeToString
public static java.lang.String nullSafeToString(char[] array)
Return a String representation of the contents of the specified array.The String representation consists of a list of the array's elements, enclosed in curly braces (
"{}"). Adjacent elements are separated by the characters", "(a comma followed by a space). Returns"null"ifarrayisnull.- Parameters:
array- the array to build a String representation for- Returns:
- a String representation of
array
-
nullSafeToString
public static java.lang.String nullSafeToString(double[] array)
Return a String representation of the contents of the specified array.The String representation consists of a list of the array's elements, enclosed in curly braces (
"{}"). Adjacent elements are separated by the characters", "(a comma followed by a space). Returns"null"ifarrayisnull.- Parameters:
array- the array to build a String representation for- Returns:
- a String representation of
array
-
nullSafeToString
public static java.lang.String nullSafeToString(float[] array)
Return a String representation of the contents of the specified array.The String representation consists of a list of the array's elements, enclosed in curly braces (
"{}"). Adjacent elements are separated by the characters", "(a comma followed by a space). Returns"null"ifarrayisnull.- Parameters:
array- the array to build a String representation for- Returns:
- a String representation of
array
-
nullSafeToString
public static java.lang.String nullSafeToString(int[] array)
Return a String representation of the contents of the specified array.The String representation consists of a list of the array's elements, enclosed in curly braces (
"{}"). Adjacent elements are separated by the characters", "(a comma followed by a space). Returns"null"ifarrayisnull.- Parameters:
array- the array to build a String representation for- Returns:
- a String representation of
array
-
nullSafeToString
public static java.lang.String nullSafeToString(long[] array)
Return a String representation of the contents of the specified array.The String representation consists of a list of the array's elements, enclosed in curly braces (
"{}"). Adjacent elements are separated by the characters", "(a comma followed by a space). Returns"null"ifarrayisnull.- Parameters:
array- the array to build a String representation for- Returns:
- a String representation of
array
-
nullSafeToString
public static java.lang.String nullSafeToString(short[] array)
Return a String representation of the contents of the specified array.The String representation consists of a list of the array's elements, enclosed in curly braces (
"{}"). Adjacent elements are separated by the characters", "(a comma followed by a space). Returns"null"ifarrayisnull.- Parameters:
array- the array to build a String representation for- Returns:
- a String representation of
array
-
-