Class ChangedLengthTrait

java.lang.Object
software.amazon.smithy.diff.evaluators.AbstractDiffEvaluator
software.amazon.smithy.diff.evaluators.ChangedLengthTrait
All Implemented Interfaces:
DiffEvaluator

public final class ChangedLengthTrait extends AbstractDiffEvaluator
Detects when the Length trait is made more restrictive by either raising the min or lowering the max.
  • Constructor Details

    • ChangedLengthTrait

      public ChangedLengthTrait()
  • Method Details

    • getTraitType

      protected Class<software.amazon.smithy.model.traits.LengthTrait> getTraitType()
    • getMin

      protected Optional<BigDecimal> getMin(software.amazon.smithy.model.traits.LengthTrait t)
    • getMax

      protected Optional<BigDecimal> getMax(software.amazon.smithy.model.traits.LengthTrait t)
    • evaluate

      public final List<software.amazon.smithy.model.validation.ValidationEvent> evaluate(Differences differences)
      Description copied from interface: DiffEvaluator
      Returns validation events given two models and the detected differences between them.
      Parameters:
      differences - Detected differences.
      Returns:
      Returns validation events that are relative to the new model.