THING - The type of thing.public interface OptionalThing<THING>
| 修飾子とタイプ | メソッドと説明 |
|---|---|
void |
alwaysPresent(OptionalThingConsumer<THING> oneArgLambda)
Handle the thing in the optional thing or exception if not present.
|
static <EMPTY> OptionalThing<EMPTY> |
empty() |
OptionalThing<THING> |
filter(OptionalThingPredicate<THING> oneArgLambda)
Filter the thing by the predicate.
|
<RESULT> OptionalThing<RESULT> |
flatMap(OptionalThingFunction<? super THING,OptionalThing<RESULT>> oneArgLambda)
Apply the flat-mapping of thing to result thing.
|
THING |
get()
Get the thing or exception if null.
|
OptionalThingIfPresentAfter |
ifPresent(OptionalThingConsumer<THING> oneArgLambda)
Handle the wrapped thing if it is present.
|
boolean |
isPresent()
Is the object instance present?
|
<RESULT> OptionalThing<RESULT> |
map(OptionalThingFunction<? super THING,? extends RESULT> oneArgLambda)
Apply the mapping of thing to result thing.
|
static <THING> OptionalThing<THING> |
of(THING object) |
static <THING> OptionalThing<THING> |
ofNullable(THING object,
OptionalThingExceptionThrower noArgLambda) |
THING |
orElse(THING other)
Get the wrapped instance or returns the specified thing.
|
THING |
orElseGet(OptionalThingSupplier<THING> noArgLambda)
Get the thing or get from the supplier.
|
THING |
orElseNull()
非推奨です。
basically use ifPresent() or use orElse(null)
|
<CAUSE extends Throwable> |
orElseThrow(OptionalThingSupplier<? extends CAUSE> supplier)
Get the thing or throw the exception.
|
Optional<THING> |
toOptional()
Convert to Java standard optional class.
|
static <EMPTY> OptionalThing<EMPTY> empty()
EMPTY - The type of empty optional thing.static <THING> OptionalThing<THING> of(THING object)
THING - The type of thing wrapped in the optional thing.object - The wrapped thing which is optional. (NotNull)static <THING> OptionalThing<THING> ofNullable(THING object, OptionalThingExceptionThrower noArgLambda)
THING - The type of thing wrapped in the optional thing.object - The wrapped instance or thing. (NullAllowed)noArgLambda - The callback for exception when illegal access. (NotNull)OptionalThingIfPresentAfter ifPresent(OptionalThingConsumer<THING> oneArgLambda)
oneArgLambda - The callback interface to consume the optional thing. (NotNull)boolean isPresent()
THING get()
EntityAlreadyDeletedException - When the object instance wrapped in this optional thing is null, which means object has already been deleted (point is not found).OptionalThing<THING> filter(OptionalThingPredicate<THING> oneArgLambda)
oneArgLambda - The callback to predicate whether the object is remained. (NotNull)<RESULT> OptionalThing<RESULT> map(OptionalThingFunction<? super THING,? extends RESULT> oneArgLambda)
RESULT - The type of mapping result.oneArgLambda - The callback interface to apply, null return allowed as empty. (NotNull)<RESULT> OptionalThing<RESULT> flatMap(OptionalThingFunction<? super THING,OptionalThing<RESULT>> oneArgLambda)
RESULT - The type of mapping result.oneArgLambda - The callback interface to apply, cannot return null. (NotNull)THING orElse(THING other)
other - The object instance to be returned when the optional is empty. (NullAllowed)THING orElseGet(OptionalThingSupplier<THING> noArgLambda)
noArgLambda - The supplier of other instance if null. (NotNull)<CAUSE extends Throwable> THING orElseThrow(OptionalThingSupplier<? extends CAUSE> supplier) throws CAUSE extends Throwable
CAUSE - The type of cause.supplier - The supplier of exception if null. (NotNull)CAUSE - When the value is null.CAUSE extends ThrowableOptional<THING> toOptional()
void alwaysPresent(OptionalThingConsumer<THING> oneArgLambda)
oneArgLambda - The callback interface to consume the optional thing. (NotNull)EntityAlreadyDeletedException - When the object instance wrapped in this optional thing is null, which means object has already been deleted (point is not found).THING orElseNull()
Copyright © 2014–2015 The DBFlute Project. All rights reserved.