T - the type of the output value to wrap.public final class OptionalOutput<T>
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
T |
getValue() |
T |
getValue(boolean forced) |
boolean |
isAbsent() |
boolean |
isPresent() |
boolean |
isSerialize() |
static <T> OptionalOutput<T> |
of(T value)
Creates an instance which is serialized by default.
|
static <T> OptionalOutput<T> |
of(T value,
boolean serialize)
Creates an instance with a flag indicating if given value shall be serialized or not.
|
public static <T> OptionalOutput<T> of(T value)
T - the type of the output value to wrapvalue - the output value (can be null)public static <T> OptionalOutput<T> of(T value, boolean serialize)
T - the type of the output value to wrapvalue - the output value (can be null)serialize - true if the value shall be serialized, false otherwise.public boolean isSerialize()
public boolean isPresent()
public boolean isAbsent()
public T getValue()
null otherwise.public T getValue(boolean forced)
forced - if value shall be returned independent of serialization flag is set or not.null).Copyright © 2013–2019 52North Initiative for Geospatial Open Source Software GmbH. All rights reserved.