- java.lang.Object
-
- life.expert.value.numeric.PositiveLong
-
- All Implemented Interfaces:
java.lang.Comparable<PositiveLong>
public final class PositiveLong extends java.lang.Object implements java.lang.Comparable<PositiveLong>
Simple value-object long wrapper. Class invariant: value > 0 - only the monoOf.. factory methods is allowed, because it allows you to lazily create objects only with a real subscription - 'of' - factory method is prohibited because it is intended only for easy creation of objects in tests, please use pure functional methods monoOf.., without raise exceptions. Preconditions: none Postconditions: none Side effects: none Tread safety: Immutable
-
-
Constructor Summary
Constructors Constructor Description PositiveLong()
-
Method Summary
Modifier and Type Method Description intcompareTo(PositiveLong o)static reactor.core.publisher.Mono<PositiveLong>copyOf(PositiveLong other)Standard Copy Factorystatic reactor.core.publisher.Mono<PositiveLong>monoOf(long number)Create PositiveLong from long Only the monoOf..static reactor.core.publisher.Mono<PositiveLong>monoOfMono(reactor.core.publisher.Mono<java.lang.Long> number)Create PositiveLong from Mono with positive number inside The method helps chaining flows togetherstatic reactor.core.publisher.Mono<PositiveLong>monoOfMonoWithTuple(reactor.core.publisher.Mono<io.vavr.Tuple1<java.lang.Long>> tuple)Create PositiveLong from Mono with Tuple inside The method helps chaining flows togetherstatic reactor.core.publisher.Mono<PositiveLong>monoOfTuple(io.vavr.Tuple1<java.lang.Long> tuple)Create PositiveLong from Tuple The method helps with conversion operations Tuple->PositiveLongstatic PositiveLongof(long number)Deprecated.please use pure functional methods monoOf.., without raise exceptions.java.lang.StringtoString()
-
-
-
Method Detail
-
monoOf
public static reactor.core.publisher.Mono<PositiveLong> monoOf(long number)
Create PositiveLong from long Only the monoOf.. factory methods is allowed, because it allows you to lazily create objects only with a real subscription- Parameters:
number- the number- Returns:
- the Mono with lazyli created object
- Implementation Note:
- to create objects, this method calls the private factory monoOf_
-
of
@Deprecated public static PositiveLong of(long number)
Deprecated.please use pure functional methods monoOf.., without raise exceptions.Classic fabric method for creating positive number. This factory method is prohibited because it is intended only for easy creation of objects in tests
- Parameters:
number- the number- Returns:
- the always positive number
- Throws:
java.lang.IllegalArgumentException- if number not positive
-
monoOfTuple
public static reactor.core.publisher.Mono<PositiveLong> monoOfTuple(io.vavr.Tuple1<java.lang.Long> tuple)
Create PositiveLong from Tuple The method helps with conversion operations Tuple->PositiveLong- Parameters:
tuple- the tuple- Returns:
- the Mono with lazyli created object
-
monoOfMonoWithTuple
public static reactor.core.publisher.Mono<PositiveLong> monoOfMonoWithTuple(reactor.core.publisher.Mono<io.vavr.Tuple1<java.lang.Long>> tuple)
Create PositiveLong from Mono with Tuple inside The method helps chaining flows together- Parameters:
tuple- the tuple- Returns:
- the Mono with lazyli created object
-
monoOfMono
public static reactor.core.publisher.Mono<PositiveLong> monoOfMono(reactor.core.publisher.Mono<java.lang.Long> number)
Create PositiveLong from Mono with positive number inside The method helps chaining flows together- Parameters:
number- the number- Returns:
- the Mono with lazyli created object
-
copyOf
public static reactor.core.publisher.Mono<PositiveLong> copyOf(PositiveLong other)
Standard Copy Factory- Parameters:
other- the other- Returns:
- the Mono with lazyli created object
- Implementation Note:
- to create objects, this method calls the private factory monoOf_
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
compareTo
public int compareTo(PositiveLong o)
- Specified by:
compareToin interfacejava.lang.Comparable<PositiveLong>
-
-