Interface Generator
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
enum types, String and BigInteger.
Most methods provide a default implementation that (directly or indirectly) uses anyBits(int).
The latter is the only method without a default implementation.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault BigIntegerdefault BigIntegeranyBigInteger(BigInteger bound) default BigIntegeranyBigInteger(BigInteger min, BigInteger bound) anyBits(int numBits) Returns any non-negativeBigIntegerrepresenting a sequence of significant bits of a given length.static BigIntegerUtility method: Returns a randomly generated non-negativeBigIntegerrepresenting a sequence of significant bits of a given length, intended as a result of anyBits(int).default booleanReturns anybooleanvalue.default byteanyByte()Returns anybytevalue.default charanyChar()Returns anycharvalue of a predefined character set.default charReturns anycharvalue of the givencharacters.default doubleReturns adoublevalue between zero (incl.) and one (excl.).default floatanyFloat()Returns afloatvalue between zero (incl.) and one (excl.).default intanyInt()Returns anyintvalue.default intanyInt(int bound) Returns anintvalue betweenzero(incl.) andbound(excl.).default intanyInt(int min, int bound) Returns anintvalue betweenmin(incl.) andbound(excl.).default longanyLong()Returns anylongvalue.default longanyLong(long bound) Returns anylongvalue betweenzero(incl.) andbound(excl.).default longanyLong(long min, long bound) Returns anylongvalue betweenmin(incl.) andbound(excl.).default <T extends Enum<T>>
TReturns one of the givenenumvalues.default <T> TanyOf(T... values) Returns one of the givenvalues.default shortanyShort()Returns anyshortvalue.default BigIntegerReturns aBigIntegervalue between zero (incl.) and 216 (excl.).default BigIntegeranySmallBigInteger(BigInteger bound) default intanySmallInt(int bound) Returns anintvalue betweenzero(incl.) andbound(excl.).default StringReturns aStringwith a length between 1 and 64 consisting of a predefined character set.default Stringstatic GeneratorUtility method: Provides a new instance based on a givenRandom.
-
Method Details
-
anyBits
Utility method: Returns a randomly generated non-negativeBigIntegerrepresenting a sequence of significant bits of a given length, intended as a result of anyBits(int). -
of
Utility method: Provides a new instance based on a givenRandom. -
anyBoolean
default boolean anyBoolean()Returns anybooleanvalue.A typical implementation will return one of {true, false}, with each possible value being equally probable.
The default implementation depends on the implementation of
anyBits(int). -
anyByte
default byte anyByte()Returns anybytevalue.A typical implementation will return an arbitrary
bytevalue, with each possible value being equally probable.The default implementation depends on the implementation of
anyBits(int). -
anyShort
default short anyShort()Returns anyshortvalue.A typical implementation will return an arbitrary
shortvalue, with each possible value being equally probable.The default implementation depends on the implementation of
anyBits(int). -
anyInt
default int anyInt()Returns anyintvalue.A typical implementation will return an arbitrary
intvalue, with each possible value being equally probable.The default implementation depends on the implementation of
anyBits(int). -
anyInt
default int anyInt(int bound) Returns anintvalue betweenzero(incl.) andbound(excl.).A typical implementation will return an arbitrary
intvalue within the defined bounds, with each possible value being equally probable.The default implementation depends on the implementation of
anyBits(int). -
anyInt
default int anyInt(int min, int bound) Returns anintvalue betweenmin(incl.) andbound(excl.).A typical implementation will return an arbitrary
intvalue within the defined bounds, with each possible value being equally probable.The default implementation depends on the implementation of
anyBits(int). -
anySmallInt
default int anySmallInt(int bound) Returns anintvalue betweenzero(incl.) andbound(excl.).A typical implementation will return an arbitrary
intvalue within the defined bounds, with smaller values being more probable than bigger values.The default implementation depends on the implementation of
anyBits(int). -
anyLong
default long anyLong()Returns anylongvalue.A typical implementation will return an arbitrary
longvalue, with each possible value being equally probable.The default implementation depends on the implementation of
anyBits(int). -
anyLong
default long anyLong(long bound) Returns anylongvalue betweenzero(incl.) andbound(excl.).A typical implementation will return an arbitrary
longvalue within the defined bounds, with each possible value being equally probable.The default implementation depends on the implementation of
anyBits(int). -
anyLong
default long anyLong(long min, long bound) Returns anylongvalue betweenmin(incl.) andbound(excl.).A typical implementation will return an arbitrary
longvalue within the defined bounds, with each possible value being equally probable.The default implementation depends on the implementation of
anyBits(int). -
anyFloat
default float anyFloat()Returns afloatvalue between zero (incl.) and one (excl.).A typical implementation will return an arbitrary
longvalue within the defined bounds, with each possible value being equally probable.The default implementation depends on the implementation of
anyBits(int). -
anyDouble
default double anyDouble()Returns adoublevalue between zero (incl.) and one (excl.).A typical implementation will return an arbitrary
longvalue within the defined bounds, with each possible value being equally probable.The default implementation depends on the implementation of
anyBits(int). -
anyBigInteger
Returns aBigIntegervalue betweenLong.MIN_VALUEandLong.MAX_VALUE(both incl.).A typical implementation will return an arbitrary
BigIntegervalue within the defined bounds, with each possible value being equally probable.The default implementation depends on the implementation of
anyBits(int). -
anyBigInteger
Returns aBigIntegervalue betweenBigInteger.ZERO(incl.) andbound(excl.).A typical implementation will return an arbitrary
BigIntegervalue within the defined bounds, with each possible value being equally probable.The default implementation depends on the implementation of
anyBits(int). -
anyBigInteger
Returns aBigIntegervalue betweenmin(incl.) andbound(excl.).A typical implementation will return an arbitrary
BigIntegervalue within the defined bounds, with each possible value being equally probable.The default implementation depends on the implementation of
anyBits(int). -
anySmallBigInteger
Returns aBigIntegervalue between zero (incl.) and 216 (excl.).A typical implementation will return an arbitrary
BigIntegervalue within the defined bounds, with smaller values being more probable than bigger values.The default implementation depends on the implementation of
anyBits(int). -
anySmallBigInteger
Returns aBigIntegervalue betweenBigInteger.ZERO(incl.) andbound(excl.).A typical implementation will return an arbitrary value within the defined bounds, with smaller values being more probable than bigger values.
The default implementation depends on the implementation of
anyBits(int). -
anyChar
default char anyChar()Returns anycharvalue of a predefined character set.A typical implementation will return an arbitrary
charvalue within the predefined character set, with each possible value being equally probable.The default implementation depends on the implementation of
anyBits(int)and returns one of"0123456789_abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ !#$§%&*+,.?@äöüÄÖÜß". -
anyChar
Returns anycharvalue of the givencharacters.A typical implementation will return an arbitrary
charvalue within the given characters, with each possible value being equally probable.The default implementation depends on the implementation of
anyBits(int).- Parameters:
characters- AStringmade up of the characters that are a possible result.
-
anyString
Returns aStringwith the givenlengthconsisting of the givencharacters.The default implementation depends on the implementation of
anyBits(int).- Parameters:
length- The length of the resulting string.characters- A string made up of the characters that make up a possible result.
-
anyString
Returns aStringwith a length between 1 and 64 consisting of a predefined character set.The default implementation depends on the implementation of
anyBits(int)and uses"0123456789_abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ !#$§%&*+,.?@äöüÄÖÜß"as predefined character set. -
anyOf
default <T> T anyOf(T... values) Returns one of the givenvalues.A typical implementation will return an arbitrary value within the defined bounds, with each possible value being equally probable.
The default implementation depends on the implementation of
anyBits(int). -
anyOf
Returns one of the givenenumvalues.A typical implementation will return an arbitrary value within the defined bounds, with each possible value being equally probable.
The default implementation depends on the implementation of
anyBits(int). -
anyBits
Returns any non-negativeBigIntegerrepresenting a sequence of significant bits of a given length. In other words, the result is any value between zero (inclusive) and 2length (exclusive).A typical implementation will return an arbitrary value within the defined bounds, with each possible value being equally probable.
-