Class SizeConstraintExtractor

java.lang.Object
dev.orne.test.rnd.params.AbstractParametersSourceExtractor<SizeParameters,javax.validation.constraints.Size>
dev.orne.test.rnd.params.SizeConstraintExtractor
All Implemented Interfaces:
ParametersSourceExtractor<SizeParameters,javax.validation.constraints.Size>

@API(status=EXPERIMENTAL, since="0.1") public class SizeConstraintExtractor extends AbstractParametersSourceExtractor<SizeParameters,javax.validation.constraints.Size>
Generation parameters extractor that detects Size constraint annotations and sets SizeParameters.minSize and SizeParameters.maxSize.

As int is a primitive type target's minSize value will be the maximum of it's prior value and sources's value. Same way target's maxSize value will be the minimum of it's prior value and sources's value.

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

    • SizeConstraintExtractor

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

    • extractParameters

      public void extractParameters(@NotNull @NotNull javax.validation.constraints.Size from, @NotNull @NotNull SizeParameters target)
      Extracts the parameters from the specified source, modifying the generation parameters as required.
      Parameters:
      from - The metadata source
      target - The target generation parameters