Class ByteArraySpec

java.lang.Object
guru.mikelue.foxglove.instancio.ByteArraySpec
All Implemented Interfaces:
Supplier<byte[]>, GeneratorSpec<byte[]>, ValueSpec<byte[]>

public class ByteArraySpec extends Object implements ValueSpec<byte[]>
Provides a ValueSpec for byte array(byte[]).
  • Constructor Details

    • ByteArraySpec

      public ByteArraySpec()
      Constructs the byte array spec.
  • Method Details

    • length

      public ByteArraySpec length(int length)
      Sets the length of the array.
      Parameters:
      length - the exact length of the array
      Returns:
      this instance
    • minLength

      public ByteArraySpec minLength(int min)
      Sets the minimum length of the array (inclusive).
      Parameters:
      min - minimum length
      Returns:
      this instance
    • maxLength

      public ByteArraySpec maxLength(int max)
      Sets the maximum length of the array (inclusive).
      Parameters:
      max - maximum length
      Returns:
      this instance
    • zeroElements

      public ByteArraySpec zeroElements()
      Sets whether zero elements (0x00) should be generated.
      Returns:
      this instance
    • get

      public byte[] get()
      Specified by:
      get in interface Supplier<byte[]>
      Specified by:
      get in interface ValueSpec<byte[]>
    • nullable

      public ValueSpec<byte[]> nullable()
      Specified by:
      nullable in interface ValueSpec<byte[]>