Class RandomValue

java.lang.Object
ru.objectsfill.core.RandomValue

public final class RandomValue extends Object
The RandomValue class is designed to populate POJO classes with random data.
  • Method Details

    • fill

      public static <T> T fill(Fill fill)
      Fills the given object with random values.
      Type Parameters:
      T - The type of the target object.
      Parameters:
      fill - The object containing all the information about the target object.
      Returns:
      The filled object.
    • fill

      public static <T> T fill(Object object)
      Fills the given object with random values shorter.
      Type Parameters:
      T - The type of the target object.
      Parameters:
      object - The object to create fill.
      Returns:
      The filled object.
    • fill

      public static <T> T fill(Class<?> clazz)
      Fills the given object with random values shorter.
      Type Parameters:
      T - The type of the target object.
      Parameters:
      clazz - The class to create fill.
      Returns:
      The filled object.
    • fillCollection

      public static <T extends Collection<K>, K> void fillCollection(T collection, Fill fill)
      Fills the given collection with random values.
      Type Parameters:
      T - The type of the collection.
      K - The type of the elements in the collection.
      Parameters:
      collection - The collection type for populating.
      fill - The object containing all the information about the target collection.
    • fillStream

      public static <K> Stream<K> fillStream(Fill fill)
      Fills the given collection with random values.
      Type Parameters:
      K - The type of stream
      Parameters:
      fill - The object containing all the information about the target collection.
      Returns:
      not closed stream
    • fillArray

      public static <T> T[] fillArray(Fill fill)
      Creates and fills an array with random values.
      Type Parameters:
      T - The type of the elements in the array.
      Parameters:
      fill - The object containing all the information about the target array.
      Returns:
      The filled array.
    • fillSingleVal

      public static <K> K fillSingleVal(Fill fill)
      Generates a single random value.
      Type Parameters:
      K - The type of the value.
      Parameters:
      fill - The object containing all the information about the target value.
      Returns:
      The generated value.