Package com.javaquery.util
Class Objects
- java.lang.Object
-
- com.javaquery.util.Objects
-
public final class Objects extends java.lang.Object
- Since:
- 1.0
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
equals(java.lang.Object a, java.lang.Object b)
Returnstrue
if the arguments are equal to each other andfalse
otherwise.static boolean
isNull(java.lang.Object obj)
Returnstrue
if the provided reference isnull
otherwise returnsfalse
.static void
isNull(java.lang.Object obj, ExecutableFunction executableFunction)
Execute code if the provided reference isnull
.static boolean
nonNull(java.lang.Object obj)
Returnstrue
if the provided reference is non-null
otherwise returnsfalse
.static void
nonNull(java.lang.Object obj, ExecutableFunction executableFunction)
Execute code if the provided reference is non-null
.
-
-
-
Method Detail
-
isNull
public static boolean isNull(java.lang.Object obj)
Returnstrue
if the provided reference isnull
otherwise returnsfalse
.- Parameters:
obj
- a reference to be checked againstnull
- Returns:
true
if the provided reference isnull
otherwisefalse
-
isNull
public static void isNull(java.lang.Object obj, ExecutableFunction executableFunction)
Execute code if the provided reference isnull
.- Parameters:
obj
- a reference to be checked againstnull
executableFunction
- lambda function given executed if the provided reference isnull
.
-
nonNull
public static boolean nonNull(java.lang.Object obj)
Returnstrue
if the provided reference is non-null
otherwise returnsfalse
.- Parameters:
obj
- a reference to be checked againstnull
- Returns:
true
if the provided reference is non-null
otherwisefalse
-
nonNull
public static void nonNull(java.lang.Object obj, ExecutableFunction executableFunction)
Execute code if the provided reference is non-null
.- Parameters:
obj
- a reference to be checked againstnull
executableFunction
- lambda function given executed if the provided reference is non-null
.
-
equals
public static boolean equals(java.lang.Object a, java.lang.Object b)
Returnstrue
if the arguments are equal to each other andfalse
otherwise. Consequently, if both arguments arenull
,true
is returned and if exactly one argument isnull
,false
is returned. Otherwise, equality is determined by using theequals
method of the first argument.- Parameters:
a
- an objectb
- an object to be compared witha
for equality- Returns:
true
if the arguments are equal to each other andfalse
otherwise- See Also:
Object.equals(Object)
-
-