Class EnumFill

java.lang.Object
ru.objectsfill.types.object_type.EnumFill
All Implemented Interfaces:
ObjectCollectionFillExtension, ObjectTypeFill

public class EnumFill extends Object implements ObjectTypeFill
This class implements the ObjectTypeFill interface to provide object generation for enum types. It generates random enum values based on the provided enum class.
  • Constructor Details

    • EnumFill

      public EnumFill()
  • Method Details

    • generate

      public Object generate(Class<?> fieldType, Fill fill)
      Generates a random enum value for the given enum type and fill parameters.
      Specified by:
      generate in interface ObjectTypeFill
      Parameters:
      fieldType - the enum type
      fill - the fill parameters for object generation
      Returns:
      a random enum value
    • fillStream

      public Stream<Object> fillStream(Class<?> collectionGenericType, Fill fill)
      Generates a stream of random enum values for the given collection generic type and fill parameters.
      Specified by:
      fillStream in interface ObjectCollectionFillExtension
      Parameters:
      collectionGenericType - the generic type of the collection (enum type)
      fill - the fill parameters for object generation
      Returns:
      a stream of random enum values