L
- type of the left valueR
- type of the right valuepublic abstract class Xor<L,R> extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Xor.Left<L,R>
Left branch of the Xor
|
static class |
Xor.Right<L,R>
Right branch of the Xor
|
Constructor and Description |
---|
Xor() |
Modifier and Type | Method and 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) |
public static <L,R> Xor.Left<L,R> left(L value)
public static <L,R> Xor.Right<L,R> right(R value)
public abstract boolean isRight()
public abstract boolean isLeft()
public abstract <T> T fold(Function<? super L,? extends T> mapLeft, Function<? super R,? extends T> mapRight)
public abstract void consume(Consumer<? super L> consumerLeft, Consumer<? super R> consumerRight)
Copyright © 2016. All rights reserved.