Class LongSeq

    • Constructor Detail

      • LongSeq

        public LongSeq​(long start,
                       long increment,
                       long max,
                       long min,
                       boolean cycle)
      • LongSeq

        public LongSeq​(long start,
                       long increment)
      • LongSeq

        public LongSeq​(long increment)
      • LongSeq

        public LongSeq()
    • Method Detail

      • longSeq

        public static LongSeq longSeq()

        Returns a LongSeq object that can be used to generate arbitrary Long numbers in a sequence.

        Returns:
        A re-usable LongSeq object. The LongSeq class implements MockUnitLong.
      • start

        public LongSeq start​(long start)

        Sets the start value of the LongSeq.

        By default the starting value is 0.

        Parameters:
        start - The starting value.
        Returns:
        The same LongSeq object.
      • increment

        public LongSeq increment​(long increment)

        Sets the increment of the LongSeq.

        By default the increment value is 1.

        Parameters:
        increment - The increment's value.
        Returns:
        The same LongSeq object.
      • cycle

        public LongSeq cycle​(boolean cycle)

        Enables or disables the "cycling" in the elements, if the max value was reached.

        Parameters:
        cycle - The status of "cycling".
        Returns:
        The same LongSeq object.
      • max

        public LongSeq max​(long max)

        Sets the max value that can be generated by the current LongSeq.

        By default, the value is set Long.MAX_VALUE.

        Parameters:
        max - The max value that can be generated by the current LongSeq.
        Returns:
        The same LongSeq object.
      • min

        public LongSeq min​(long min)

        Sets the min value that can be generated by the current LongSeq.

        By default, the value is set to Long.MIN_VALUE

        Parameters:
        min - The min value that can be generated by the current LongSeq
        Returns:
        The same LongSeq object.
      • fail

        protected void fail()
      • supplier

        public java.util.function.Supplier<java.lang.Long> supplier()
        Description copied from interface: MockUnit
        This is the sole abstract method of the interface. Needs to be implemented every-time a MockUnit is implemented.
        Specified by:
        supplier in interface MockUnit<java.lang.Long>
        Returns:
        A Supplier<T>.