public interface Semigroups
Semigroup<Maybe<Integer>> m = Semigroups.combineZippables(Semigroups.intMax);
Semigroup<ReactiveSeq<Integer>> m = Semigroups.combineZippables(Semigroups.intSum);
Modifier and Type | Field and Description |
---|---|
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> |
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> |
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> |
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<Bag<T>> |
bagConcat() |
static <T> Semigroup<BankersQueue<T>> |
bankersQueueConcat() |
static <T> Semigroup<ReactiveSeq<T>> |
combineReactiveSeq() |
static <T,A extends Zippable<T>> |
combineScalarFunctors(java.util.function.BiFunction<T,T,T> semigroup)
BinaryOperator<Maybe<Integer>> sumMaybes = Semigroups.combineScalarFunctors(Semigroups.intSum);
Maybe.just(1)
.combine(sumMaybes, Maybe.just(5))
//Maybe[6]
|
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<Seq<Integer>> sumInts = Semigroups.combineZippables(Semigroups.intSum);
sumInts.apply(Seq.of(1,2,3), Seq.of(4,5,6));
//List[5,7,9];
|
static <T> Semigroup<java.util.concurrent.CompletableFuture<T>> |
firstCompleteCompletableFuture() |
static <T> Semigroup<Future<T>> |
firstCompleteFuture() |
static <ST,PT> Semigroup<Either<ST,PT>> |
firstLeftEither() |
static <T,C extends java.util.Collection<T>> |
firstNonEmpty() |
static <T> Semigroup<ReactiveSeq<T>> |
firstNonEmptyReactiveSeq() |
static <T> Semigroup<T> |
firstNonNull() |
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<Either<ST,PT>> |
firstRightEither() |
static <ST,PT> Semigroup<Ior<ST,PT>> |
firstSecondaryIor() |
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> Semigroup<HashSet<T>> |
hashSetConcat() |
static <T,C extends ImmutableList<T>> |
immutableListConcat() |
static <T> Semigroup<IntMap<T>> |
intMapConcat() |
static <ST,PT> Semigroup<Either<ST,PT>> |
lastLeftEither() |
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<Either<ST,PT>> |
lastRightEither() |
static <ST,PT> Semigroup<Ior<ST,PT>> |
lastSecondaryIor() |
static <T,X extends java.lang.Throwable> |
lastTryFailure() |
static <T,X extends java.lang.Throwable> |
lastTrySuccess() |
static <T> Semigroup<LazySeq<T>> |
lazySeqConcat() |
static <T> Semigroup<LazyString> |
lazyStringConcat() |
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 <A> Semigroup<NaturalTransformation<A,A>> |
naturalTransformationComposition() |
static <T> Semigroup<NonEmptyList<T>> |
nonEmptyListConcat() |
static <T,C extends PersistentCollection<T>> |
persistentCollectionConcat() |
static <T> Semigroup<Seq<T>> |
seqConcat() |
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<TreeSet<T>> |
treeSetConcat() |
static <T> Semigroup<TrieSet<T>> |
trieSetConcat() |
static <T> Semigroup<Vector<T>> |
vectorConcat() |
static <T> Semigroup<Future<T>> |
zippedFutures(Semigroup<T> s) |
static <T> Semigroup<ReactiveSeq<T>> |
zipReactiveSeq(Semigroup<T> s) |
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 PersistentCollection<T>> Semigroup<C> persistentCollectionConcat()
static <T,C extends ImmutableList<T>> Semigroup<C> immutableListConcat()
static <T> Semigroup<NonEmptyList<T>> nonEmptyListConcat()
static <T> Semigroup<BankersQueue<T>> bankersQueueConcat()
static <T> Semigroup<LazyString> lazyStringConcat()
static <T,A extends Zippable<T>> Semigroup<A> combineZippables(java.util.function.BiFunction<T,T,T> semigroup)
BinaryOperator<Seq<Integer>> sumInts = Semigroups.combineZippables(Semigroups.intSum);
sumInts.apply(Seq.of(1,2,3), Seq.of(4,5,6));
//List[5,7,9];
semigroup
- Semigroup to combine the values inside the zippablesstatic <T,A extends Zippable<T>> Semigroup<A> combineScalarFunctors(java.util.function.BiFunction<T,T,T> semigroup)
BinaryOperator<Maybe<Integer>> sumMaybes = Semigroups.combineScalarFunctors(Semigroups.intSum);
Maybe.just(1)
.combine(sumMaybes, Maybe.just(5))
//Maybe[6]
semigroup
- Semigroup to combine the values inside the Scalar Functors (Maybe, Xor, Ior, Try, Eva, FeatureToggle etc)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<ReactiveSeq<T>> zipReactiveSeq(Semigroup<T> s)
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<Future<T>> firstSuccessfulFuture()
static <ST,PT> Semigroup<Either<ST,PT>> firstRightEither()
static <ST,PT> Semigroup<Either<ST,PT>> firstLeftEither()
static <ST,PT> Semigroup<Either<ST,PT>> lastRightEither()
static <ST,PT> Semigroup<Either<ST,PT>> lastLeftEither()
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()
static <A> Semigroup<NaturalTransformation<A,A>> naturalTransformationComposition()