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

Method of

corpus/java/training/guava/base/Optional.java:106–108  ·  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

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

Callers 14

tryFindMethod · 0.95
firstMethod · 0.95
lastMethod · 0.95
sizeIfKnownMethod · 0.95
sizeIfKnownMethod · 0.95
sizeIfKnownMethod · 0.95
sizeIfKnownMethod · 0.95
lengthIfKnownMethod · 0.95
lengthIfKnownMethod · 0.95
getEnumIfPresentMethod · 0.95
charsetMethod · 0.95
expectedNodeCountMethod · 0.95

Calls 1

checkNotNullMethod · 0.45

Tested by

no test coverage detected