Nullable

Constructors

this
this()
Undocumented in source.
this
this(T v)
Undocumented in source.

Alias This

value

Members

Aliases

payload
alias payload = value
Undocumented in source.

Functions

get
T get()

If a value is present, returns the value, otherwise throws {@code NoSuchElementException}.

ifPresent
void ifPresent(Consumer!T action)

If a value is present, performs the given action with the value, otherwise does nothing.

isNull
bool isNull()
Undocumented in source. Be warned that the author may not have intended to support it.
isPresent
bool isPresent()

If a value is present, returns {@code true}, otherwise {@code false}.

opEquals
bool opEquals(IObject o)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(T v)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(const(Object) o)
Undocumented in source. Be warned that the author may not have intended to support it.
toHash
size_t toHash()
Undocumented in source. Be warned that the author may not have intended to support it.
toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.
value
T value()
Undocumented in source. Be warned that the author may not have intended to support it.
valueType
TypeInfo valueType()
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

empty
Nullable!U empty()

Returns an empty {@code Nullable} instance. No value is present for this {@code Nullable}.

of
Nullable!U of(U value)

Returns an {@code Nullable} describing the given non-{@code null} value.

ofNullable
Nullable!U ofNullable(U value)

Returns an {@code Nullable} describing the given value, if non-{@code null}, otherwise returns an empty {@code Nullable}.

Variables

_value
T _value;
Undocumented in source.

Meta