Class Longs
- All Implemented Interfaces:
MockUnit<java.lang.Long>,MockUnitLong
public class Longs extends MockUnitBase implements MockUnitLong
-
Field Summary
-
Constructor Summary
-
Method Summary
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, waitMethods 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, valStrMethods inherited from interface net.andreinc.mockneat.abstraction.MockUnitLong
array, arrayPrimitive, longStream
-
Constructor Details
-
Method Details
-
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
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
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
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
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
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
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.
-