Class IntSeq

java.lang.Object
net.andreinc.mockneat.unit.seq.IntSeq
All Implemented Interfaces:
MockUnit<java.lang.Integer>, MockUnitInt

public class IntSeq
extends java.lang.Object
implements MockUnitInt
  • Constructor Details

    • IntSeq

      public IntSeq​(int start, int increment, int max, int min, boolean cycle)
    • IntSeq

      public IntSeq​(int start, int increment)
    • IntSeq

      public IntSeq​(int increment)
    • IntSeq

      public IntSeq()
  • Method Details

    • intSeq

      public static IntSeq intSeq()

      Returns a IntSeq object that can be used to generate arbitrary Integer numbers in a sequence.

      Returns:
      A re-usable IntSeq object. The IntSeq class implements MockUnitInt.
    • start

      public IntSeq start​(int start)

      Sets the start value of the IntSeq.

      By default the starting value is 0.

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

      public IntSeq increment​(int increment)

      Sets the increment of the IntSeq.

      By default the increment value is 1.

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

      public IntSeq 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 IntSeq object.
    • max

      public IntSeq max​(int max)

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

      By default, the value is set Integer.MAX_VALUE.

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

      public IntSeq min​(int min)

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

      By default, the value is set to Integer.MIN_VALUE

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

      public java.util.function.Supplier<java.lang.Integer> 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.Integer>
      Returns:
      A Supplier<T>.