Class ChangedMemberTarget

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

public final class ChangedMemberTarget extends AbstractDiffEvaluator
Checks for changes in the shapes targeted by a member.

If the new target is not a compatible type, the emitted event will be an ERROR. The new target is not compatible if any of the following are true:

  • The new target is a different shape type than the old target.
  • The target is a shape type whose name is significant to code generation, such as structures and enums.
  • The new target is a list whose member is not a compatible type with the old target's member.
  • The new target is a map whose key or value is not a compatible type with the old target's key or value.

If the types are compatible, the emitted event will default to a WARNING. This is elevated if any trait changes would result in a higher severity.

  • Constructor Details

    • ChangedMemberTarget

      public ChangedMemberTarget()
  • Method Details

    • evaluate

      public List<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.
    • evaluate

      public List<ValidationEvent> evaluate(ClassLoader classLoader, Differences differences)