Class ModifiedTrait

  • All Implemented Interfaces:
    DiffEvaluator

    public final class ModifiedTrait
    extends AbstractDiffEvaluator
    Finds breaking changes related to when a trait is added, removed, or updated.

    This evaluator looks for trait definitions with specific tags. When traits that use these tags are added, removed, or updated, a validation event is emitted for the change. This evaluator honors the following tags:

    • diff.error.add: It is an error to add a trait to an existing shape.
    • diff.error.remove: It is an error to remove this trait from a shape.
    • diff.error.update: It is an error to change the value of this shape.
    • diff.error.const: It is an error to add, remove, or change a trait.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String DIFF_ERROR_ADD
      Tags that indicates a breaking change if a trait is added.
      static java.lang.String DIFF_ERROR_CONST
      Tags that indicates a breaking change if a trait is added, removed, or changed.
      static java.lang.String DIFF_ERROR_REMOVE
      Tags that indicates a breaking change if a trait is removed.
      static java.lang.String DIFF_ERROR_UPDATE
      Tags that indicates a breaking change if a trait is updated.
    • Constructor Summary

      Constructors 
      Constructor Description
      ModifiedTrait()  
    • Field Detail

      • DIFF_ERROR_ADD

        public static final java.lang.String DIFF_ERROR_ADD
        Tags that indicates a breaking change if a trait is added.
        See Also:
        Constant Field Values
      • DIFF_ERROR_REMOVE

        public static final java.lang.String DIFF_ERROR_REMOVE
        Tags that indicates a breaking change if a trait is removed.
        See Also:
        Constant Field Values
      • DIFF_ERROR_UPDATE

        public static final java.lang.String DIFF_ERROR_UPDATE
        Tags that indicates a breaking change if a trait is updated.
        See Also:
        Constant Field Values
      • DIFF_ERROR_CONST

        public static final java.lang.String DIFF_ERROR_CONST
        Tags that indicates a breaking change if a trait is added, removed, or changed.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ModifiedTrait

        public ModifiedTrait()
    • Method Detail

      • evaluate

        public java.util.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.