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

Method of

output/java_guava/1.4.13/Optional.java:108–110  ·  view source on GitHub ↗

Returns an Optional instance containing the given non-null reference. To have null treated as #absent, use #fromNullable instead. Comparison to java.util.Optional: no differences. @throws NullPointerException if reference is null

(T reference)

Source from the content-addressed store, hash-verified

106
107
108 public static <T> Optional<T> of(T reference) {
109 return new Present<T>(checkNotNull(reference));
110 }
111
112 /**
113 * If {@code nullableReference} is non-null, returns an {@code Optional} instance containing that

Callers 1

getEnumIfPresentMethod · 0.95

Calls 1

checkNotNullMethod · 0.45

Tested by

no test coverage detected