Module life.expert

Class 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
      int compareTo​(PositiveLong o)  
      static reactor.core.publisher.Mono<PositiveLong> copyOf​(PositiveLong other)
      Standard Copy Factory
      static 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 together
      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
      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
      static PositiveLong of​(long 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

      • PositiveLong

        public PositiveLong()
    • 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:
        toString in class java.lang.Object
      • compareTo

        public int compareTo​(PositiveLong o)
        Specified by:
        compareTo in interface java.lang.Comparable<PositiveLong>