Module life.expert

Class PositiveInteger

  • All Implemented Interfaces:
    java.lang.Comparable<PositiveInteger>

    public final class PositiveInteger
    extends java.lang.Object
    implements java.lang.Comparable<PositiveInteger>
     Simple value-object int 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
      PositiveInteger()  
    • Method Summary

      Modifier and Type Method Description
      int compareTo​(PositiveInteger o)  
      static reactor.core.publisher.Mono<PositiveInteger> copyOf​(PositiveInteger other)
      Standard Copy Factory
      static reactor.core.publisher.Mono<PositiveInteger> monoOf​(int number)
      Create PositiveInteger from integer Only the monoOf..
      static reactor.core.publisher.Mono<PositiveInteger> monoOfMono​(reactor.core.publisher.Mono<java.lang.Integer> number)
      Create PositiveInteger from Mono with positive number inside The method helps chaining flows together
      static reactor.core.publisher.Mono<PositiveInteger> monoOfMonoWithTuple​(reactor.core.publisher.Mono<io.vavr.Tuple1<java.lang.Integer>> tuple)
      Create PositiveInteger from Mono with Tuple inside The method helps chaining flows together
      static reactor.core.publisher.Mono<PositiveInteger> monoOfTuple​(io.vavr.Tuple1<java.lang.Integer> tuple)
      Create PositiveInteger from Tuple The method helps with conversion operations Tuple->PositiveInteger
      static PositiveInteger of​(int number)
      Deprecated.
      please use pure functional methods monoOf.., without raise exceptions.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • PositiveInteger

        public PositiveInteger()
    • Method Detail

      • monoOf

        public static reactor.core.publisher.Mono<PositiveInteger> monoOf​(int number)
        Create PositiveInteger from integer 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 PositiveInteger of​(int 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<PositiveInteger> monoOfTuple​(io.vavr.Tuple1<java.lang.Integer> tuple)
        Create PositiveInteger from Tuple The method helps with conversion operations Tuple->PositiveInteger
        Parameters:
        tuple - the tuple
        Returns:
        the Mono with lazyli created object
      • monoOfMonoWithTuple

        public static reactor.core.publisher.Mono<PositiveInteger> monoOfMonoWithTuple​(reactor.core.publisher.Mono<io.vavr.Tuple1<java.lang.Integer>> tuple)
        Create PositiveInteger 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<PositiveInteger> monoOfMono​(reactor.core.publisher.Mono<java.lang.Integer> number)
        Create PositiveInteger 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<PositiveInteger> copyOf​(PositiveInteger 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:
        toString in class java.lang.Object