Package com.suse.salt.netapi.utils
Class Xor<L,R>
- java.lang.Object
-
- com.suse.salt.netapi.utils.Xor<L,R>
-
- Type Parameters:
L
- type of the left valueR
- type of the right value
public abstract class Xor<L,R> extends Object
Right biased disjunction mainly based on the Xor type from scala cats library. This type is used for collecting salt errors that are in the place of a normal result.
-
-
Constructor Summary
Constructors Constructor Description Xor()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
consume(Consumer<? super L> consumerLeft, Consumer<? super R> consumerRight)
abstract boolean
exists(Predicate<R> p)
abstract <T> Xor<? super L,T>
flatMap(Function<? super R,Xor<? super L,T>> mapper)
abstract <T> T
fold(Function<? super L,? extends T> mapLeft, Function<? super R,? extends T> mapRight)
abstract R
getOrElse(Supplier<? extends R> supplier)
abstract boolean
isLeft()
abstract boolean
isRight()
abstract Optional<L>
left()
static <L,R>
Xor.Left<L,R>left(L value)
abstract <T> Xor<L,T>
map(Function<? super R,? extends T> mapper)
Optional<R>
option()
abstract R
orElse(R value)
abstract Optional<R>
right()
static <L,R>
Xor.Right<L,R>right(R value)
-
-
-
Method Detail
-
left
public static <L,R> Xor.Left<L,R> left(L value)
-
right
public static <L,R> Xor.Right<L,R> right(R value)
-
isRight
public abstract boolean isRight()
-
isLeft
public abstract boolean isLeft()
-
fold
public abstract <T> T fold(Function<? super L,? extends T> mapLeft, Function<? super R,? extends T> mapRight)
-
consume
public abstract void consume(Consumer<? super L> consumerLeft, Consumer<? super R> consumerRight)
-
flatMap
public abstract <T> Xor<? super L,T> flatMap(Function<? super R,Xor<? super L,T>> mapper)
-
-