Maybe.Just<T>
Modifier and Type | Method and Description |
---|---|
void |
consumeJust(java.util.function.Consumer<T> consumer)
Consumes value if present.
|
boolean |
equals(java.lang.Object o) |
Maybe<T> |
filter(java.util.function.Predicate<? super T> predicate) |
<U> Maybe<U> |
flatMap(java.util.function.Function<? super T,Maybe<U>> mapper)
Flat map.
|
int |
hashCode() |
boolean |
isJust()
Returns
true if value is present. |
boolean |
isNothing()
Returns
false if value is not present. |
java.util.Iterator<T> |
iterator() |
<U> Maybe<U> |
map(java.util.function.Function<? super T,? extends U> mapper)
Map.
|
<V> V |
maybe(V defaultValue,
java.util.function.Function<T,V> function)
Takes a default value and a function.
|
java.util.Optional<T> |
optional()
Converts Maybe to the Java Optional.
|
Maybe<T> |
or(Maybe<T> maybeDefaultValue)
Use give maybe if this one is NOTHING.
|
Maybe<T> |
or(java.util.function.Supplier<? extends Maybe<? extends T>> supplier)
Use supplied value if this one is NOTHING.
|
Maybe<T> |
or(T otherValue)
Use a maybe of given value if this one is NOTHING.
|
java.util.stream.Stream<T> |
stream()
Returns empty or single-element stream.
|
java.lang.String |
toString() |
public boolean isJust()
Maybe
true
if value is present.public boolean isNothing()
Maybe
false
if value is not present.public <V> V maybe(V defaultValue, java.util.function.Function<T,V> function)
Maybe
public void consumeJust(java.util.function.Consumer<T> consumer)
Maybe
consumeJust
in interface Maybe<T>
public java.util.Iterator<T> iterator()
iterator
in interface java.lang.Iterable<T>
public java.util.stream.Stream<T> stream()
Maybe
public Maybe<T> or(T otherValue)
Maybe
public Maybe<T> or(Maybe<T> maybeDefaultValue)
Maybe
public Maybe<T> or(java.util.function.Supplier<? extends Maybe<? extends T>> supplier)
Maybe
public <U> Maybe<U> map(java.util.function.Function<? super T,? extends U> mapper)
Maybe
public <U> Maybe<U> flatMap(java.util.function.Function<? super T,Maybe<U>> mapper)
Maybe
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
Copyright © 2003-present Jodd Team