F
- Type of value Enabled Switch holdspublic static class FeatureToggle.Enabled<F> extends java.lang.Object implements FeatureToggle<F>
Switch<Data> data = Switch.enabled(data); data.map(this::load); //data will be loaded because Switch is of type Enabled
FeatureToggle.Disabled<F>, FeatureToggle.Enabled<F>
ApplicativeFunctor.Applicatives, ApplicativeFunctor.ApplyFunctions<T>
Value.ValueImpl<T>
Convertable.SupplierToConvertable<T>
Modifier and Type | Method and Description |
---|---|
AnyMValue<F> |
anyM() |
AnyMValue<F> |
anyMDisabled() |
AnyMValue<F> |
anyMEnabled() |
static <F> AnyM<F> |
anyMOf(F f)
Create a new enabled switch
|
boolean |
equals(java.lang.Object obj) |
F |
get() |
int |
hashCode() |
boolean |
isDisabled() |
boolean |
isEnabled() |
static <F> FeatureToggle.Enabled<F> |
of(F f)
Create a new enabled switch
|
java.lang.String |
toString() |
<R> R |
visit(java.util.function.Function<? super F,? extends R> enabled,
java.util.function.Function<? super F,? extends R> disabled)
If this FeatureToggle is enabled the enabled function will be executed
If this FeatureToggle is disabled the disabled function will be executed
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
cast, coflatMap, combine, combine, combineEager, disable, disable, enable, enable, filter, filterNot, flatMap, flatMapIterable, flatMapPublisher, flip, forEach, from, iterator, map, narrow, nest, notNull, ofType, optional, patternMatch, peek, stream, toFeatureToggle, trampoline, unit, zip, zip, zip, zip, zip, zip, zip
applyFunctions
collect, fold, fold, generate, iterate, mapReduce, mkString, newSubscriber, subscribe, test, toDequeX, toEvalAlways, toEvalLater, toEvalNow, toFutureStream, toFutureStream, toIor, toLazyImmutable, toList, toListX, toMaybe, toMutable, toPBagX, toPOrderedSetX, toPQueueX, toPSetX, toPStackX, toPVectorX, toQueueX, toSetX, toSimpleReact, toSimpleReact, toSortedSetX, toTry, toTry, toTry, toXor, toXor, unapply
endsWith, endsWithIterable, findAny, findFirst, firstValue, foldable, foldRight, foldRight, foldRight, foldRightMapToType, get, groupBy, join, join, join, mapReduce, print, print, printErr, printOut, reduce, reduce, reduce, reduce, reduce, reduce, reduce, schedule, scheduleFixedDelay, scheduleFixedRate, single, single, singleOptional, startsWith, startsWithIterable, toConcurrentLazyCollection, toConcurrentLazyStreamable, toLazyCollection, validate, xMatch
collect, fromSupplier, isPresent, orElse, orElseGet, orElseThrow, toAtomicReference, toCompletableFuture, toCompletableFutureAsync, toCompletableFutureAsync, toFutureW, toFutureWAsync, toFutureWAsync, toOptional, toOptionalAtomicReference, toStream, visit
toOptional, visit
matches
public AnyMValue<F> anyM()
anyM
in interface FeatureToggle<F>
anyM
in interface MonadicValue<F>
anyM
in interface MonadicValue1<F>
public AnyMValue<F> anyMDisabled()
anyMDisabled
in interface FeatureToggle<F>
public AnyMValue<F> anyMEnabled()
anyMEnabled
in interface FeatureToggle<F>
public static <F> FeatureToggle.Enabled<F> of(F f)
public static <F> AnyM<F> anyMOf(F f)
f
- switch valuepublic F get()
get
in interface FeatureToggle<F>
get
in interface Convertable<F>
get
in interface java.util.function.Supplier<F>
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public final boolean isEnabled()
isEnabled
in interface FeatureToggle<F>
public final boolean isDisabled()
isDisabled
in interface FeatureToggle<F>
public <R> R visit(java.util.function.Function<? super F,? extends R> enabled, java.util.function.Function<? super F,? extends R> disabled)
FeatureToggle
visit
in interface FeatureToggle<F>
enabled
- Function to execute if enableddisabled
- Function to execute if disabled