Class Longs
- java.lang.Object
-
- net.andreinc.mockneat.abstraction.MockUnitBase
-
- net.andreinc.mockneat.unit.types.Longs
-
- All Implemented Interfaces:
MockUnit<java.lang.Long>,MockUnitLong
public class Longs extends MockUnitBase implements MockUnitLong
-
-
Field Summary
-
Fields inherited from class net.andreinc.mockneat.abstraction.MockUnitBase
mockNeat
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MockUnitLongbound(java.lang.Long bound)This method returns aMockUnitLongthat can be used to generate arbitrary numbers in the [0, bound) interval.MockUnitLongfrom(long[] alphabet)This method returns aMockUnitLongthat can be used to generate arbitrary long numbers from the given alphabet.static Longslongs()Returns aLongsobject that can be used to generate arbitraryLongnumbers.MockUnitLonglowerBound(long lowerBound)This method can be used to generate arbitrary long value in [lowerBound, Long.MAX_VALUE]MockUnitLongrange(java.lang.Long lowerBound, java.lang.Long upperBound)This method returns aMockUnitLongthat can be used generate arbitrary numbers in the given range: [loweBound, upperBound)MockUnitLongrangeClosed(long lowerBound, long upperBound)This method return aMockUnitLongthat can be used to generate arbitrary numbers in the given closed range: [lowerBound, upperBound]java.util.function.Supplier<java.lang.Long>supplier()This is the sole abstract method of the interface.MockUnitLongupperBound(long upperBound)This method returns aMockUnitLongthat can be used to generate arbitrary numbers in the [0, bound) interval.-
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
-
-
-
-
Constructor Detail
-
Longs
protected Longs()
-
Longs
public Longs(MockNeat mockNeat)
-
-
Method Detail
-
longs
public static Longs longs()
Returns a
Longsobject that can be used to generate arbitraryLongnumbers.Note:By default the internal
Random.nextLong()will be called.- Returns:
- A re-usable
Longsobject. TheLongsclass extends theMockUnitLongclass.
-
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.
-
bound
public MockUnitLong bound(java.lang.Long bound)
This method returns a
MockUnitLongthat can be used to generate arbitrary numbers in the [0, bound) interval.- Parameters:
bound- The interval's bound.- Returns:
- A new
MockUnitLong.
-
upperBound
public MockUnitLong upperBound(long upperBound)
This method returns a
MockUnitLongthat can be used to generate arbitrary numbers in the [0, bound) interval.- Parameters:
upperBound- The interval's bound.- Returns:
- A new
MockUnitLong.
-
lowerBound
public MockUnitLong lowerBound(long lowerBound)
This method can be used to generate arbitrary long value in [lowerBound, Long.MAX_VALUE]
- Parameters:
lowerBound- The lower bound. Should be different than Long.MAX_VALUE and bigger than 0.- Returns:
- A new
MockUnitLong
-
range
public MockUnitLong range(java.lang.Long lowerBound, java.lang.Long upperBound)
This method returns a
MockUnitLongthat can be used generate arbitrary numbers in the given range: [loweBound, upperBound)- Parameters:
lowerBound- The lower bound of the interval.upperBound- The upper bound of the interval.- Returns:
- A new
MockUnitLong.
-
rangeClosed
public MockUnitLong rangeClosed(long lowerBound, long upperBound)
This method return a
MockUnitLongthat can be used to generate arbitrary numbers in the given closed range: [lowerBound, upperBound]- Parameters:
lowerBound- The lower bound of the interval.upperBound- The upper bound of the interval.- Returns:
- A new
MockUnitLong.
-
from
public MockUnitLong from(long[] alphabet)
This method returns a
MockUnitLongthat can be used to generate arbitrary long numbers from the given alphabet.- Parameters:
alphabet- The alphabet from which the values are selected.- Returns:
- A new
MockUnitLong.
-
-