Class CustomBasicGenerator

java.lang.Object
dev.orne.test.rnd.AbstractGenerator
dev.orne.test.rnd.it.CustomBasicGenerator
All Implemented Interfaces:
Generator

public class CustomBasicGenerator extends AbstractGenerator
Custom generator for an enumeration type that prevents generation of an undesired value.

Registered through META-INF/services/dev.orne.test.rnd.Generator SPI.

Generator has no Priority annotation, so gets the default priority (0), which is greater than built in enumeration values generator (-2000) and therefore takes precedence for generation of the supported types.

Since:
0.1
Version:
1.0, 2022-10
Author:
(w) Iker Hernaez
See Also:
  • Constructor Details

    • CustomBasicGenerator

      public CustomBasicGenerator()
      Creates a new instance.
  • Method Details

    • supports

      public boolean supports(@NotNull @NotNull Class<?> type)
    • defaultValue

      @NotNull public <T> T defaultValue(@NotNull @NotNull Class<T> type)
    • randomValue

      @NotNull public <T> T randomValue(@NotNull @NotNull Class<T> type)