Class ModelDiff.Builder

  • Enclosing class:
    ModelDiff

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

      • classLoader

        public ModelDiff.Builder classLoader​(java.lang.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​(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​(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​(ValidatedResult<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​(ValidatedResult<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:
        java.lang.IllegalStateException - if oldModel and newModel are not set.