Package net.shibboleth.shared.primitive
Class ObjectSupport
java.lang.Object
net.shibboleth.shared.primitive.ObjectSupport
Helper methods for working with Objects.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TfirstNonNull(T... objects) Return the first from a list of arguments that is non-null, or null if all arguments are null.
-
Constructor Details
-
ObjectSupport
private ObjectSupport()Constructor.
-
-
Method Details
-
firstNonNull
Return the first from a list of arguments that is non-null, or null if all arguments are null.This is similar to Guava's
MoreObjects.firstNonNull(Object, Object), except it takes more than 2 arguments, and also doesn't throw a null pointer exception if all arguments are null.- Type Parameters:
T- the type of arguments being evaluated- Parameters:
objects- the list of object references to evaluate- Returns:
- the first non-null argument, or null if all arguments are null
-