Class LongGenerator

java.lang.Object
mocka.generator.AbstractGenerator<Long>
mocka.generator.primitive.LongGenerator
All Implemented Interfaces:
Generator<Long>

public class LongGenerator extends AbstractGenerator<Long>
  • Method Details

    • getInstance

      public static LongGenerator getInstance()
    • get

      public Long get()
      returns a random long value.
    • getLong

      public Long getLong()
      returns a random long within the full long range [Long.MIN_VALUE, Long.MAX_VALUE].
    • getLong

      public Long getLong(Long min, Long max)
      returns a random long between the given min and max values [min, max].
    • getNextLong

      public Long getNextLong(Long n)
      returns a random long between [0, n].
    • getEvenLong

      public Long getEvenLong()
      returns a random even long within the valid range, avoiding overflow at Long.MAX_VALUE.
    • getOddLong

      public Long getOddLong()
      returns a random odd long within the valid range, avoiding overflow at Long.MAX_VALUE.
    • getPositiveLong

      public Long getPositiveLong()
      returns a random positive long (1L, Long.MAX_VALUE].
    • getNegativeLong

      public Long getNegativeLong()
      returns a random negative long [Long.MIN_VALUE, -1L).
    • pickFrom

      public Long pickFrom(List<Long> list)
      picks a random long from the given list.
    • pickFrom

      public Long pickFrom(Long[] longs)
      picks a random long from the given array.