Class ArrayHint.Builder

java.lang.Object
org.instancio.generator.hints.ArrayHint.Builder
Enclosing class:
ArrayHint

public static final class ArrayHint.Builder extends Object
Builder class for this hint.
  • Method Details

    • nullableElements

      public ArrayHint.Builder nullableElements(boolean nullableElements)
      Indicates whether null elements are allowed to be generated.
      Parameters:
      nullableElements - if true, null elements allowed
      Returns:
      builder instance
      Since:
      2.0.0
    • shuffle

      public ArrayHint.Builder shuffle(boolean shuffle)
      Indicates whether array elements, once populated, should be randomly shuffled. The shuffle implementation ensures that results are reproducible per given seed.
      Parameters:
      shuffle - if true, elements will be shuffled
      Returns:
      builder instance
      Since:
      2.0.0
    • withElements

      public <T> ArrayHint.Builder withElements(List<? extends T> elements)
      Additional elements to be inserted into the array by the engine during the population process. This method can be invoked more than once.
      Type Parameters:
      T - element type
      Parameters:
      elements - elements to be inserted into the array in addition to the random elements generated by the engine
      Returns:
      builder instance
      Since:
      2.0.0
    • build

      public ArrayHint build()
      Builds the object.
      Returns:
      the built instance.