MCPcopy Create free account
hub / github.com/tomaszpolanski/Options / ofObj

Method ofObj

options/core/src/main/java/polanski/option/Option.java:148–152  ·  view source on GitHub ↗

Option created from given @value @param value Value that should be wrapped in an Option @param Input type @return Some of the @value if it is not null, otherwise None

(@Nullable final IN value)

Source from the content-addressed store, hash-verified

146 * @return Some of the @value if it is not null, otherwise None
147 */
148 @SuppressWarnings("unchecked")
149 @NotNull
150 public static <IN> Option<IN> ofObj(@Nullable final IN value) {
151 return value == null ? Option.NONE : new Some(value);
152 }
153
154 /**
155 * Option of value returned by the function

Calls

no outgoing calls