Class ModelDiff.Builder

java.lang.Object
software.amazon.smithy.diff.ModelDiff.Builder
Enclosing class:
ModelDiff

public static final class ModelDiff.Builder extends Object
Builder used to construct a diff of two Smithy models.
  • Method Details

    • classLoader

      public ModelDiff.Builder classLoader(ClassLoader classLoader)
      Sets the ClassLoader used to find DiffEvaluator service providers.
      Parameters:
      classLoader - ClassLoader to use.
      Returns:
      Returns the builder.
    • oldModel

      public ModelDiff.Builder oldModel(software.amazon.smithy.model.Model oldModel)
      Sets the old model to compare against.
      Parameters:
      oldModel - Old version of a model.
      Returns:
      Returns the builder.
    • newModel

      public ModelDiff.Builder newModel(software.amazon.smithy.model.Model newModel)
      Sets the new model to compare against.
      Parameters:
      newModel - New version of a model.
      Returns:
      Returns the builder.
    • oldModel

      public ModelDiff.Builder oldModel(software.amazon.smithy.model.validation.ValidatedResult<software.amazon.smithy.model.Model> oldModel)
      Sets the old model to compare against along with the validation events encountered while loading the model.
      Parameters:
      oldModel - Old version of a model with events.
      Returns:
      Returns the builder.
    • newModel

      public ModelDiff.Builder newModel(software.amazon.smithy.model.validation.ValidatedResult<software.amazon.smithy.model.Model> newModel)
      Sets the new model to compare against along with the validation events encountered while loading the model.
      Parameters:
      newModel - New version of a model with events.
      Returns:
      Returns the builder.
    • compare

      public ModelDiff.Result compare()
      Performs the diff of the old and new models.
      Returns:
      Returns the diff ModelDiff.Result.
      Throws:
      IllegalStateException - if oldModel and newModel are not set.