OBJ - The type of wrapped object in the optional object.public abstract class BaseOptional<OBJ> extends Object implements OptionalThing<OBJ>
| 修飾子とタイプ | フィールドと説明 |
|---|---|
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, filter, flatMap, get, ifPresent, isPresent, map, orElse, orElseGet, orElseNull, orElseThrowprotected 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 void callbackAlwaysPresent(OptionalThingConsumer<OBJ> objLambda)
objLambda - The callback interface to consume the wrapped value. (NotNull)protected OptionalThingIfPresentAfter callbackIfPresent(OptionalThingConsumer<OBJ> consumer)
consumer - The callback interface to consume the wrapped object. (NotNull)protected OBJ directlyGet()
protected OBJ directlyGetOrElse(OBJ other)
other - The other instance to be returned if null. (NullAllowed: if null, returns null when entity is null)protected OBJ directlyGetOrElseGet(OptionalThingSupplier<OBJ> supplier)
supplier - The supplier of other instance if null. (NotNull)protected <CAUSE extends Throwable> OBJ directlyGetOrElseThrow(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 Throwableprotected OptionalThing<OBJ> callbackFilter(OptionalThingPredicate<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, return s 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, return s 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, return s empty optional)public Optional<OBJ> toOptional()
toOptional インタフェース内 OptionalThing<OBJ>Copyright © 2014–2015 The DBFlute Project. All rights reserved.