public final class Objects
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.Object |
coalesce(java.lang.Object first,
java.lang.Object second)
Returns the first non-
null object from the provided two objects. |
public static java.lang.Object coalesce(java.lang.Object first, java.lang.Object second)
null
object from the provided two objects. So, if the first object is not
null
, then it will be returned, otherwise the second object will be returned.first
- The first object.second
- The second object.null
object from the provided two objects.