Package net.andreinc.mockneat.unit.seq
Class LongSeq
- java.lang.Object
-
- net.andreinc.mockneat.unit.seq.LongSeq
-
- All Implemented Interfaces:
MockUnit<java.lang.Long>,MockUnitLong
public class LongSeq extends java.lang.Object implements MockUnitLong
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LongSeqcycle(boolean cycle)Enables or disables the "cycling" in the elements, if the max value was reached.protected voidfail()LongSeqincrement(long increment)Sets theincrementof theLongSeq.static LongSeqlongSeq()Returns aLongSeqobject that can be used to generate arbitraryLongnumbers in a sequence.LongSeqmax(long max)Sets the max value that can be generated by the currentLongSeq.LongSeqmin(long min)Sets the min value that can be generated by the currentLongSeq.LongSeqstart(long start)Sets thestartvalue of theLongSeq.java.util.function.Supplier<java.lang.Long>supplier()This is the sole abstract method of the interface.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.andreinc.mockneat.abstraction.MockUnit
array, array, collection, collection, collection, collection, collection, collection, consume, consume, get, get, list, list, list, list, list, list, map, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapToDouble, mapToInt, mapToLocalDate, mapToLong, mapToString, mapToString, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, serialize, set, set, set, set, set, set, stream, val, val, valStr, valStr
-
Methods inherited from interface net.andreinc.mockneat.abstraction.MockUnitLong
array, arrayPrimitive, longStream
-
-
-
-
Method Detail
-
longSeq
public static LongSeq longSeq()
Returns a
LongSeqobject that can be used to generate arbitraryLongnumbers in a sequence.- Returns:
- A re-usable
LongSeqobject. TheLongSeqclass implementsMockUnitLong.
-
start
public LongSeq start(long start)
Sets the
startvalue of theLongSeq.By default the starting value is 0.
- Parameters:
start- The starting value.- Returns:
- The same
LongSeqobject.
-
increment
public LongSeq increment(long increment)
Sets the
incrementof theLongSeq.By default the increment value is 1.
- Parameters:
increment- The increment's value.- Returns:
- The same
LongSeqobject.
-
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
LongSeqobject.
-
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 currentLongSeq.- Returns:
- The same
LongSeqobject.
-
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 currentLongSeq- Returns:
- The same
LongSeqobject.
-
fail
protected void fail()
-
supplier
public java.util.function.Supplier<java.lang.Long> supplier()
Description copied from interface:MockUnitThis is the sole abstract method of the interface. Needs to be implemented every-time a MockUnit is implemented.
-
-