public final class Objects extends Object
java.util.Objects class for JDK6 support.| Modifier and Type | Method and Description |
|---|---|
static boolean |
equals(Object object,
Object... compareWith)
Returns whether the first Object equals to any Object from the specified array.
|
static boolean |
equals(Object object,
Object compareWith)
Returns whether the first Object equals to second one.
|
static int |
hash(Object... values)
Generates a hash code for a sequence of input values.
|
static boolean |
notEquals(Object object,
Object... compareWith)
Returns whether the first Object is not equals to any Object from the specified array.
|
static boolean |
notEquals(Object object,
Object compareWith)
Returns whether the first Object is not equals to the second one.
|
static <T> T |
requireNonNull(T object)
|
static <T> T |
requireNonNull(T object,
String message)
|
static <T> T |
requireNonNull(T object,
Supplier<RuntimeException> exceptionSupplier)
|
public static int hash(@Nullable Object... values)
Arrays.hashCode(Object[]).values - the values to be hashedArrays.hashCode(Object[])public static boolean equals(@Nullable Object object, @Nullable Object compareWith)
object - object to comparecompareWith - objects to compare withpublic static boolean equals(@Nullable Object object, @Nullable Object... compareWith)
object - object to comparecompareWith - object to compare withpublic static boolean notEquals(@Nullable Object object, @Nullable Object compareWith)
object - object to comparecompareWith - object to compare withpublic static boolean notEquals(@Nullable Object object, @Nullable Object... compareWith)
object - object to comparecompareWith - objects to compare with@NotNull public static <T> T requireNonNull(@Nullable T object)
T - Object typeobject - Object to check for being nullObject if not nullNullPointerException - if Object is null@NotNull public static <T> T requireNonNull(@Nullable T object, @NotNull String message)
T - Object typeobject - Object to check for being nullmessage - detailed message used in NullPointerExceptionObject if not nullNullPointerException - if Object is null@NotNull public static <T> T requireNonNull(@Nullable T object, @NotNull Supplier<RuntimeException> exceptionSupplier)
T - Object typeobject - Object to check for being nullexceptionSupplier - Supplier for a customized RuntimeExceptionObject if not nullRuntimeException - if Object is nullCopyright © 2020. All rights reserved.