| Package | Description |
|---|---|
| me.lucko.helper.function.chain |
| Modifier and Type | Method and Description |
|---|---|
Chain<T> |
Chain.apply(Consumer<? super T> action)
Applies an action to the backing object
|
Chain<T> |
Chain.applyIf(Predicate<? super T> test,
Consumer<? super T> action)
Applies an action to the backing object if the test passes.
|
Chain<T> |
Chain.applyIfNonNull(Consumer<? super T> action)
Applies an action to the backing object, if the object is not null.
|
<R> Chain<R> |
Chain.flatMap(Function<? super T,? extends Chain<? extends R>> mapper)
Transforms the backing object, and returns a new chain instance
containing the result of the transformation.
|
<R> Chain<R> |
Chain.ifElse(Predicate<? super T> test,
R passValue,
R failValue)
Returns a new chain instance containing a new value, depending on if the current
object passed the given test.
|
<R> Chain<R> |
Chain.map(Function<? super T,? extends R> mapper)
Transforms the backing object, and returns a new chain instance
containing the result of the transformation.
|
<R> Chain<R> |
Chain.mapNullSafe(Function<? super T,? extends R> nonNullMapper,
R otherValue)
Transforms the backing object and returns a new chain instance
containing the result of the transformation, if the backing object is
not null.
|
<R> Chain<R> |
Chain.mapNullSafeGet(Function<? super T,? extends R> nonNullMapper,
Supplier<? extends R> nullSupplier)
Transforms the backing object and returns a new chain instance
containing the result of the transformation, if the backing object is
not null.
|
<R> Chain<R> |
Chain.mapOrElse(Predicate<? super T> test,
Function<? super T,? extends R> passedMapper,
Function<? super T,? extends R> failedMapper)
Transforms the backing object, and returns a new chain instance
containing the result of the chosen transformation function.
|
<R> Chain<R> |
Chain.mapOrElse(Predicate<? super T> test,
Function<? super T,? extends R> passedMapper,
R otherValue)
Transforms the backing object, and returns a new chain instance
containing the result of the transformation function, if the test is passed.
|
Chain<T> |
Chain.orElse(Predicate<? super T> test,
T failValue)
Updates the backing object if the test fails, otherwise returns an identical chain.
|
Chain<T> |
Chain.orElseGet(Predicate<? super T> test,
Supplier<? extends T> failSupplier)
Updates the backing object if the test fails, otherwise returns an identical chain.
|
Chain<T> |
Chain.orElseGetIfNull(Supplier<? extends T> supplier)
Updates the backing object if it is null, otherwise returns an identical chain.
|
Chain<T> |
Chain.orElseIfNull(T otherValue)
Updates the backing object if it is null, otherwise returns an identical chain.
|
static <T> Chain<T> |
Chain.start(T object)
Creates a new chain
|
static <T> Chain<T> |
Chain.startOpt(Optional<T> optional)
Creates a new chain
|
| Modifier and Type | Method and Description |
|---|---|
<R> Chain<R> |
Chain.flatMap(Function<? super T,? extends Chain<? extends R>> mapper)
Transforms the backing object, and returns a new chain instance
containing the result of the transformation.
|
Copyright © 2022. All rights reserved.