F
- Type of value Enabled Switch holdspublic static class FeatureToggle.Disabled<F> extends java.lang.Object implements FeatureToggle<F>
Switch<Data> data = Switch.disabled(data); data.map(this::load); //data will NOT be loaded because Switch is of type Disabled
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() |
AnyM<F> |
anyMDisabled() |
AnyM<F> |
anyMEnabled() |
static <F> AnyM<F> |
anyMOf(F f)
Create a new disabled switch
|
FeatureToggle.Enabled<F> |
enable() |
boolean |
equals(java.lang.Object obj) |
F |
get() |
int |
hashCode() |
boolean |
isDisabled() |
boolean |
isEnabled() |
boolean |
isPresent() |
static <F> FeatureToggle.Disabled<F> |
of(F f)
Create a new disabled 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, filter, filterNot, flatMap, flatMapIterable, flatMapPublisher, flip, forEach, forEach2, forEach2, forEach3, forEach3, forEach4, forEach4, 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, orElse, orElseGet, orElseThrow, toAtomicReference, toCompletableFuture, toCompletableFutureAsync, toCompletableFutureAsync, toFutureW, toFutureWAsync, toFutureWAsync, toOptional, toOptionalAtomicReference, toStream, visit
toOptional, visit
matches
public FeatureToggle.Enabled<F> enable()
enable
in interface FeatureToggle<F>
public boolean isPresent()
isPresent
in interface Convertable<F>
public AnyMValue<F> anyM()
anyM
in interface FeatureToggle<F>
anyM
in interface MonadicValue<F>
public AnyM<F> anyMDisabled()
anyMDisabled
in interface FeatureToggle<F>
public AnyM<F> anyMEnabled()
anyMEnabled
in interface FeatureToggle<F>
public static <F> FeatureToggle.Disabled<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