Class BigDecimalGenerator

All Implemented Interfaces:
Generator, TypedGenerator<BigDecimal>

@API(status=STABLE, since="0.1") @Priority(-1000) public class BigDecimalGenerator extends AbstractTypedGenerator<BigDecimal>
Generator of BigDecimal and Number values.
Since:
0.1
Version:
1.0, 2022-10
Author:
(w) Iker Hernaez
  • Field Details

    • DEFAULT_VALUE

      public static final BigDecimal DEFAULT_VALUE
      The default value.
  • Constructor Details

    • BigDecimalGenerator

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

    • supports

      public boolean supports(@NotNull @NotNull Class<?> type)
      Checks if values of the specified type can be generated by this instance.
      Specified by:
      supports in interface Generator
      Overrides:
      supports in class AbstractTypedGenerator<BigDecimal>
      Parameters:
      type - The type to check.
      Returns:
      If values of the specified type can be generated.
    • defaultValue

      @NotNull public @NotNull BigDecimal defaultValue()
      Returns the default value of the supported type.
      Returns:
      The default value.
    • randomValue

      @NotNull public @NotNull BigDecimal randomValue()
      Returns a random value of the supported type.
      Returns:
      A random value.
    • randomBigDecimal

      public static BigDecimal randomBigDecimal()
      Generates a random BigDecimal with unescaled value between -1032 and 1032 (both excluded) and scale between -1022 and 1023 (both included).
      Returns:
      A random BigDecimal value