Package guru.mikelue.foxglove.instancio
Class ByteArraySpec
java.lang.Object
guru.mikelue.foxglove.instancio.ByteArraySpec
- All Implemented Interfaces:
Supplier<byte[]>,GeneratorSpec<byte[]>,ValueSpec<byte[]>
Provides a
ValueSpec for byte array(byte[]).-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]get()length(int length) Sets the length of the array.maxLength(int max) Sets the maximum length of the array (inclusive).minLength(int min) Sets the minimum length of the array (inclusive).ValueSpec<byte[]> nullable()Sets whether zero elements (0x00) should be generated.
-
Constructor Details
-
ByteArraySpec
public ByteArraySpec()Constructs the byte array spec.
-
-
Method Details
-
length
Sets the length of the array.- Parameters:
length- the exact length of the array- Returns:
- this instance
-
minLength
Sets the minimum length of the array (inclusive).- Parameters:
min- minimum length- Returns:
- this instance
-
maxLength
Sets the maximum length of the array (inclusive).- Parameters:
max- maximum length- Returns:
- this instance
-
zeroElements
Sets whether zero elements (0x00) should be generated.- Returns:
- this instance
-
get
public byte[] get() -
nullable
-