OBJ - The type of wrapped object in the optional object.public abstract class BaseOptional<OBJ> extends Object implements OptionalThing<OBJ>, Serializable
| 修飾子とタイプ | フィールドと説明 |
|---|---|
protected OBJ |
_obj
The wrapped object for this optional object.
|
protected OptionalThingExceptionThrower |
_thrower
The exception thrower e.g. when wrapped object is not found.
|
protected static OptionalThingIfPresentAfter |
IF_PRESENT_AFTER_EMPTY |
protected static OptionalThingIfPresentAfter |
IF_PRESENT_AFTER_NONE_FIRE |
| コンストラクタと説明 |
|---|
BaseOptional(OBJ obj,
OptionalThingExceptionThrower thrower) |
alwaysPresent, empty, filter, flatMap, get, ifPresent, ifPresentOrElse, isEmpty, isPresent, map, migratedFrom, of, ofNullable, or, orElse, orElseGet, orElseThrow, orElseThrow, orElseTranslatingThrow, stream, translatedFromprotected static final OptionalThingIfPresentAfter IF_PRESENT_AFTER_EMPTY
protected static final OptionalThingIfPresentAfter IF_PRESENT_AFTER_NONE_FIRE
protected final OBJ _obj
protected final OptionalThingExceptionThrower _thrower
public BaseOptional(OBJ obj, OptionalThingExceptionThrower thrower)
protected boolean exists()
protected OptionalThingIfPresentAfter callbackIfPresent(OptionalThingConsumer<? super OBJ> consumer)
consumer - The callback interface to consume the wrapped object. (NotNull)protected void callbackIfPresentOrElse(OptionalThingConsumer<? super OBJ> presentAction, IndependentProcessor emptyAction)
protected boolean determinePresent()
protected boolean determineEmpty()
protected OBJ directlyGet()
protected OptionalThing<OBJ> callbackOr(OptionalThingSupplier<? extends OptionalThing<? extends OBJ>> supplier)
supplier - The supplier of other optional if not present. (NotNull)protected OBJ directlyGetOrElse(OBJ other)
other - The other instance to be returned if not present. (NullAllowed: if null, returns null when entity is null)protected OBJ callbackGetOrElseGet(OptionalThingSupplier<? extends OBJ> supplier)
supplier - The supplier of other instance if not present. (NotNull)protected <CAUSE extends Throwable> OBJ callbackGetOrElseThrow(OptionalThingSupplier<? extends CAUSE> supplier) throws CAUSE extends Throwable
CAUSE - The type of cause.supplier - The supplier of exception if not present. (NotNull)CAUSE - When the value is null.CAUSE extends Throwableprotected <CAUSE extends Throwable,TRANSLATED extends Throwable> OBJ callbackGetOrElseTranslatingThrow(OptionalThingFunction<CAUSE,TRANSLATED> translator) throws TRANSLATED extends Throwable
CAUSE - The type of original cause.TRANSLATED - The type of translated cause.translator - The translator function of exception if not present. (NotNull)TRANSLATED - When the value is null.TRANSLATED extends Throwableprotected OptionalThing<OBJ> callbackFilter(OptionalThingPredicate<? super OBJ> mapper)
mapper - The callback interface to apply. (NotNull)protected abstract <ARG> OptionalThing<ARG> createOptionalFilteredObject(ARG obj)
ARG - The type of value for optional thing.obj - The plain object for the optional thing. (NullAllowed: if null, returns empty optional)protected <RESULT> OptionalThing<RESULT> callbackMapping(OptionalThingFunction<? super OBJ,? extends RESULT> mapper)
RESULT - The type of mapping result.mapper - The callback interface to apply, null return allowed as empty. (NotNull)protected abstract <ARG> OptionalThing<ARG> createOptionalMappedObject(ARG obj)
ARG - The type of value for optional thing.obj - The plain object for the optional thing. (NullAllowed: if null, returns empty optional)protected <RESULT> OptionalThing<RESULT> callbackFlatMapping(OptionalThingFunction<? super OBJ,OptionalThing<RESULT>> mapper)
RESULT - The type of mapping result.mapper - The callback interface to apply, cannot return null. (NotNull)protected abstract <ARG> OptionalThing<ARG> createOptionalFlatMappedObject(ARG obj)
ARG - The type of value for optional thing.obj - The plain object for the optional thing. (NullAllowed: if null, returns empty optional)protected Stream<OBJ> convertToStream()
protected void callbackAlwaysPresent(OptionalThingConsumer<? super OBJ> objLambda)
objLambda - The callback interface to consume the wrapped value. (NotNull)public Optional<OBJ> toOptional()
toOptional インタフェース内 OptionalThing<OBJ>protected void assertCauseLambdaNotNull(Object causeLambda)
protected void assertOneArgLambdaNotNull(Object oneArgLambda)
protected void assertNoArgLambdaNotNull(Object noArgLambda)
Copyright © 2014–2021 The DBFlute Project. All rights reserved.