MCPcopy Create free account
hub / github.com/antlr/codebuff / firstNonNull

Method firstNonNull

output/java_guava/1.4.17/MoreObjects.java:57–59  ·  view source on GitHub ↗

Returns the first of two given parameters that is not null, if either is, or otherwise throws a NullPointerException. To find the first non-null element in an iterable, use Iterables.find(iterable, Predicates.notNull()). For varargs, use {@code Iterables.find(Arrays.asLis

(@Nullable T first, @Nullable T second)

Source from the content-addressed store, hash-verified

55 */
56
57 public static <T> T firstNonNull(@Nullable T first, @Nullable T second) {
58 return first != null ? first : checkNotNull(second);
59 }
60
61 /**
62 * Creates an instance of {@link ToStringHelper}.

Callers 15

firstNonNullMethod · 0.95
getKeyEquivalenceMethod · 0.95
getKeyStrengthMethod · 0.95
getValueStrengthMethod · 0.95
removeAllMethod · 0.95
getKeyEquivalenceMethod · 0.95
getValueEquivalenceMethod · 0.95
getWeigherMethod · 0.95
getKeyStrengthMethod · 0.95
getValueStrengthMethod · 0.95
getRemovalListenerMethod · 0.95

Calls 1

checkNotNullMethod · 0.45

Tested by

no test coverage detected