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

Method fromNullable

output/java_guava/1.4.19/Optional.java:121–125  ·  view source on GitHub ↗

If nullableReference is non-null, returns an Optional instance containing that reference; otherwise returns Optional#absent. Comparison to java.util.Optional: this method is equivalent to Java 8's Optional.ofNullable.

(@Nullable T nullableReference)

Source from the content-addressed store, hash-verified

119
120
121 public static <T> Optional<T> fromNullable(@Nullable T nullableReference) {
122 return (nullableReference == null)
123 ? Optional.<T>absent()
124 : new Present<T>(nullableReference);
125 }
126
127 Optional() {}
128

Callers 1

collectOneValueMethod · 0.95

Calls 1

absentMethod · 0.95

Tested by

no test coverage detected