public interface Semigroups
Modifier and Type | Field and Description |
---|---|
static Semigroup<java.math.BigInteger> |
bigIntCount
Combine two BigIntegers by adding one toNested a (can be used toNested count BigIntegers in a Collection or Stream)
|
static Semigroup<java.math.BigInteger> |
bigIntMax
Combine two BigIntegers by selecting the max
|
static Semigroup<java.math.BigInteger> |
bigIntMin
Combine two BigIntegers by selecting the min
|
static Semigroup<java.math.BigInteger> |
bigIntMult
Combine two BigIntegers by multiplying them
|
static Semigroup<java.math.BigInteger> |
bigIntSum
Combine two BigIngegers by summing them
|
static Semigroup<java.lang.Boolean> |
booleanConjunction
Combine two booleans by AND'ing them (conjunction)
|
static Semigroup<java.lang.Boolean> |
booleanDisjunction
Combine two booleans by OR'ing them (disjunction)
|
static Semigroup<java.lang.Boolean> |
booleanXDisjunction
Combine two booleans by XOR'ing them (exclusive disjunction)
|
static Semigroup<java.lang.Double> |
doubleCount
Combine two Double by adding one toNested a (can be used toNested count Double in a Collection or Stream)
|
static Semigroup<java.lang.Double> |
doubleMax
Combine two Doubles by selecting the max
|
static Semigroup<java.lang.Double> |
doubleMin
Combine two Doubles by selecting the min
|
static Semigroup<java.lang.Double> |
doubleMult
Combine two Doubles by multiplying them
|
static Semigroup<java.lang.Double> |
doubleSum
Combine two Doubles by summing them
|
static Semigroup<java.lang.Integer> |
intCount
Combine two Integers by adding one toNested a (can be used toNested count Integers in a Collection or Stream)
|
static Semigroup<java.lang.Integer> |
intMax
Combine two Integers by selecting the max
|
static Semigroup<java.lang.Integer> |
intMin
Combine two Integers by selecting the min
|
static Semigroup<java.lang.Integer> |
intMult
Combine two Integers by multiplying them
|
static Semigroup<java.lang.Integer> |
intSum
Combine two Integers by summing them
|
static Semigroup<java.lang.Long> |
longCount
Combine two Longs by adding one toNested a (can be used toNested count Integers in a Collection or Stream)
|
static Semigroup<java.lang.Long> |
longMax
Combine two Longs by selecting the max
|
static Semigroup<java.lang.Long> |
longMin
Combine two Longs by selecting the min
|
static Semigroup<java.lang.Long> |
longMult
Combine two Longs by multiplying them
|
static Semigroup<java.lang.Long> |
longSum
Combine two Longs by summing them
|
static Semigroup<java.lang.StringBuffer> |
stringBufferConcat
StringBuffer concatenation
|
static Semigroup<java.lang.StringBuilder> |
stringBuilderConcat
StringBuilder concatenation
|
static Semigroup<java.lang.String> |
stringConcat
String concatenation
|
Modifier and Type | Method and Description |
---|---|
static <T> Semigroup<org.reactivestreams.Publisher<T>> |
amb() |
static <T> Semigroup<ReactiveSeq<T>> |
ambReactiveSeq() |
static <T> Semigroup<BagX<T>> |
bagXConcat() |
static <T,C extends java.util.Collection<T>> |
collectionConcat()
This Semigroup will attempt toNested combine JDK Collections.
|
static <T,C extends FluentCollectionX<T>> |
collectionXConcat()
To manage javac type inference first assign the semigroup
|
static <T> Semigroup<FutureStream<T>> |
combineFutureStream() |
static <T> Semigroup<ReactiveSeq<T>> |
combineReactiveSeq() |
static <T,A extends Zippable<T>> |
combineScalarFunctors(java.util.function.BiFunction<T,T,T> semigroup)
BinaryOperator<Combiner<Integer>> sumMaybes = Semigroups.combineScalarFunctors(Semigroups.intSum);
Maybe.just(1)
.combine(sumMaybes, Maybe.just(5))
//Maybe[6]
|
static <T> Semigroup<org.jooq.lambda.Seq<T>> |
combineSeq() |
static <T> Semigroup<java.util.stream.Stream<T>> |
combineStream() |
static <T,A extends Zippable<T>> |
combineZippables(java.util.function.BiFunction<T,T,T> semigroup)
BinaryOperator<Zippable<Integer>> sumInts = Semigroups.combineZippables(Semigroups.intSum);
sumInts.apply(ListX.of(1,2,3), ListX.of(4,5,6));
//List[5,7,9];
|
static <T> Semigroup<DequeX<T>> |
dequeXConcat() |
static <T> Semigroup<java.util.concurrent.CompletableFuture<T>> |
firstCompleteCompletableFuture() |
static <T> Semigroup<Future<T>> |
firstCompleteFuture() |
static <T,C extends java.util.Collection<T>> |
firstNonEmpty() |
static <T> Semigroup<ReactiveSeq<T>> |
firstNonEmptyReactiveSeq() |
static <T> Semigroup<T> |
firstNonNull() |
static <T> Semigroup<SimpleReactStream<T>> |
firstOfSimpleReact() |
static <T> Semigroup<Maybe<T>> |
firstPresentMaybe() |
static <T> Semigroup<java.util.Optional<T>> |
firstPresentOptional() |
static <ST,PT> Semigroup<Ior<ST,PT>> |
firstPrimaryIor() |
static <ST,PT> Semigroup<Xor<ST,PT>> |
firstPrimaryXor() |
static <ST,PT> Semigroup<Ior<ST,PT>> |
firstSecondaryIor() |
static <ST,PT> Semigroup<Xor<ST,PT>> |
firstSecondaryXor() |
static <T> Semigroup<Future<T>> |
firstSuccessfulFuture() |
static <T,X extends java.lang.Throwable> |
firstTryFailure() |
static <T,X extends java.lang.Throwable> |
firstTrySuccess() |
static <A> Semigroup<java.util.function.Function<A,A>> |
functionComposition() |
static <T,C extends java.util.Collection<T>> |
lastNonEmpty() |
static <T> Semigroup<Maybe<T>> |
lastPresentMaybe() |
static <T> Semigroup<java.util.Optional<T>> |
lastPresentOptional() |
static <ST,PT> Semigroup<Ior<ST,PT>> |
lastPrimaryIor() |
static <ST,PT> Semigroup<Xor<ST,PT>> |
lastPrimaryXor() |
static <ST,PT> Semigroup<Ior<ST,PT>> |
lastSecondaryIor() |
static <ST,PT> Semigroup<Xor<ST,PT>> |
lastSecondaryXor() |
static <T,X extends java.lang.Throwable> |
lastTryFailure() |
static <T,X extends java.lang.Throwable> |
lastTrySuccess() |
static <T> Semigroup<LinkedListX<T>> |
linkedListXConcat() |
static <T> Semigroup<ListX<T>> |
listXConcat() |
static <T,T2 extends java.lang.Comparable<T>> |
maxComparable() |
static <T> Semigroup<org.reactivestreams.Publisher<T>> |
mergeLatest() |
static <T> Semigroup<ReactiveSeq<T>> |
mergeLatestReactiveSeq() |
static <T,T2 extends java.lang.Comparable<T>> |
minComparable() |
static <T,C extends java.util.Collection<T>> |
mutableCollectionConcat()
Concatenate mutable collections
To manage javac type inference first assign the semigroup
|
static <T> Semigroup<java.util.Deque<T>> |
mutableDequeConcat() |
static <T> Semigroup<java.util.List<T>> |
mutableListConcat() |
static <T> Semigroup<java.util.Queue<T>> |
mutableQueueConcat() |
static <T> Semigroup<java.util.Set<T>> |
mutableSetConcat() |
static <T> Semigroup<java.util.SortedSet<T>> |
mutableSortedSetConcat() |
static <T> Semigroup<OrderedSetX<T>> |
orderedSetXConcat() |
static <T> Semigroup<PersistentQueueX<T>> |
persistentQueueXConcat() |
static <T> Semigroup<PersistentSetX<T>> |
persistentSetXConcat() |
static <T> Semigroup<QueueX<T>> |
queueXConcat() |
static <T> Semigroup<SetX<T>> |
setXConcat() |
static <T> Semigroup<SortedSetX<T>> |
sortedSetXConcat() |
static Semigroup<java.lang.StringBuffer> |
stringBufferJoin(java.lang.String joiner) |
static Semigroup<java.lang.StringBuilder> |
stringBuilderJoin(java.lang.String joiner) |
static Semigroup<java.lang.String> |
stringJoin(java.lang.String joiner) |
static <T> Semigroup<VectorX<T>> |
vectorXConcat() |
static final Semigroup<java.math.BigInteger> bigIntCount
static final Semigroup<java.lang.Integer> intCount
static final Semigroup<java.lang.Long> longCount
static final Semigroup<java.lang.Double> doubleCount
static final Semigroup<java.lang.Integer> intSum
static final Semigroup<java.lang.Long> longSum
static final Semigroup<java.lang.Double> doubleSum
static final Semigroup<java.math.BigInteger> bigIntSum
static final Semigroup<java.lang.Integer> intMult
static final Semigroup<java.lang.Long> longMult
static final Semigroup<java.lang.Double> doubleMult
static final Semigroup<java.math.BigInteger> bigIntMult
static final Semigroup<java.lang.Integer> intMax
static final Semigroup<java.lang.Long> longMax
static final Semigroup<java.lang.Double> doubleMax
static final Semigroup<java.math.BigInteger> bigIntMax
static final Semigroup<java.lang.Integer> intMin
static final Semigroup<java.lang.Long> longMin
static final Semigroup<java.lang.Double> doubleMin
static final Semigroup<java.math.BigInteger> bigIntMin
static final Semigroup<java.lang.String> stringConcat
static final Semigroup<java.lang.StringBuffer> stringBufferConcat
static final Semigroup<java.lang.StringBuilder> stringBuilderConcat
static final Semigroup<java.lang.Boolean> booleanDisjunction
static final Semigroup<java.lang.Boolean> booleanXDisjunction
static final Semigroup<java.lang.Boolean> booleanConjunction
static <T,C extends FluentCollectionX<T>> Semigroup<C> collectionXConcat()
Semigroup<ListX<Integer>> listX = Semigroups.collectionXConcat();
Semigroup<SetX<Integer>> setX = Semigroups.collectionXConcat();
static <T,C extends java.util.Collection<T>> Semigroup<C> mutableCollectionConcat()
Semigroup<List<Integer>> list = Semigroups.collectionConcat();
Semigroup<Set<Integer>> set = Semigroups.collectionConcat();
static <T> Semigroup<java.util.List<T>> mutableListConcat()
static <T> Semigroup<java.util.Set<T>> mutableSetConcat()
static <T> Semigroup<java.util.SortedSet<T>> mutableSortedSetConcat()
static <T> Semigroup<java.util.Queue<T>> mutableQueueConcat()
static <T> Semigroup<java.util.Deque<T>> mutableDequeConcat()
static <T> Semigroup<ListX<T>> listXConcat()
static <T> Semigroup<SetX<T>> setXConcat()
static <T> Semigroup<SortedSetX<T>> sortedSetXConcat()
static <T> Semigroup<QueueX<T>> queueXConcat()
static <T> Semigroup<DequeX<T>> dequeXConcat()
static <T> Semigroup<LinkedListX<T>> linkedListXConcat()
static <T> Semigroup<VectorX<T>> vectorXConcat()
static <T> Semigroup<PersistentSetX<T>> persistentSetXConcat()
static <T> Semigroup<OrderedSetX<T>> orderedSetXConcat()
static <T> Semigroup<PersistentQueueX<T>> persistentQueueXConcat()
static <T> Semigroup<BagX<T>> bagXConcat()
static <T,C extends java.util.Collection<T>> Semigroup<C> collectionConcat()
Semigroup<List<Integer>> list = Semigroups.collectionConcat();
Semigroup<Set<Integer>> set = Semigroups.collectionConcat();
static <T,A extends Zippable<T>> Semigroup<A> combineZippables(java.util.function.BiFunction<T,T,T> semigroup)
BinaryOperator<Zippable<Integer>> sumInts = Semigroups.combineZippables(Semigroups.intSum);
sumInts.apply(ListX.of(1,2,3), ListX.of(4,5,6));
//List[5,7,9];
semigroup
- Semigroup toNested combine the values inside the zippablesstatic <T,A extends Zippable<T>> Semigroup<A> combineScalarFunctors(java.util.function.BiFunction<T,T,T> semigroup)
BinaryOperator<Combiner<Integer>> sumMaybes = Semigroups.combineScalarFunctors(Semigroups.intSum);
Maybe.just(1)
.combine(sumMaybes, Maybe.just(5))
//Maybe[6]
semigroup
- Semigroup toNested combine the values inside the Scalar Functors (Maybe, Xor, Ior, Try, Eva, FeatureToggle etc)static <T> Semigroup<FutureStream<T>> combineFutureStream()
static <T> Semigroup<ReactiveSeq<T>> combineReactiveSeq()
static <T> Semigroup<ReactiveSeq<T>> firstNonEmptyReactiveSeq()
static <T> Semigroup<ReactiveSeq<T>> ambReactiveSeq()
static <T> Semigroup<ReactiveSeq<T>> mergeLatestReactiveSeq()
static <T> Semigroup<org.reactivestreams.Publisher<T>> mergeLatest()
static <T> Semigroup<org.reactivestreams.Publisher<T>> amb()
static <T> Semigroup<org.jooq.lambda.Seq<T>> combineSeq()
static <T> Semigroup<java.util.stream.Stream<T>> combineStream()
static <T,C extends java.util.Collection<T>> Semigroup<C> firstNonEmpty()
static <T,C extends java.util.Collection<T>> Semigroup<C> lastNonEmpty()
static <T> Semigroup<T> firstNonNull()
static <T> Semigroup<java.util.concurrent.CompletableFuture<T>> firstCompleteCompletableFuture()
static <T> Semigroup<Future<T>> firstCompleteFuture()
static <T> Semigroup<SimpleReactStream<T>> firstOfSimpleReact()
static <T> Semigroup<Future<T>> firstSuccessfulFuture()
static <ST,PT> Semigroup<Xor<ST,PT>> firstPrimaryXor()
static <ST,PT> Semigroup<Xor<ST,PT>> firstSecondaryXor()
static <ST,PT> Semigroup<Xor<ST,PT>> lastPrimaryXor()
static <ST,PT> Semigroup<Xor<ST,PT>> lastSecondaryXor()
static <T,X extends java.lang.Throwable> Semigroup<Try<T,X>> firstTrySuccess()
static <T,X extends java.lang.Throwable> Semigroup<Try<T,X>> firstTryFailure()
static <T,X extends java.lang.Throwable> Semigroup<Try<T,X>> lastTrySuccess()
static <T,X extends java.lang.Throwable> Semigroup<Try<T,X>> lastTryFailure()
static <ST,PT> Semigroup<Ior<ST,PT>> firstPrimaryIor()
static <ST,PT> Semigroup<Ior<ST,PT>> firstSecondaryIor()
static <ST,PT> Semigroup<Ior<ST,PT>> lastPrimaryIor()
static <ST,PT> Semigroup<Ior<ST,PT>> lastSecondaryIor()
static <T> Semigroup<Maybe<T>> firstPresentMaybe()
static <T> Semigroup<java.util.Optional<T>> firstPresentOptional()
static <T> Semigroup<Maybe<T>> lastPresentMaybe()
static <T> Semigroup<java.util.Optional<T>> lastPresentOptional()
static Semigroup<java.lang.String> stringJoin(java.lang.String joiner)
joiner
- Separator in joined Stringstatic Semigroup<java.lang.StringBuilder> stringBuilderJoin(java.lang.String joiner)
joiner
- Separator in joined Stringstatic Semigroup<java.lang.StringBuffer> stringBufferJoin(java.lang.String joiner)
joiner
- Separator in joined Stringstatic <T,T2 extends java.lang.Comparable<T>> Semigroup<T2> minComparable()
static <T,T2 extends java.lang.Comparable<T>> Semigroup<T2> maxComparable()
static <A> Semigroup<java.util.function.Function<A,A>> functionComposition()