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 Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      ModelDiff.Builder classLoader​(java.lang.ClassLoader classLoader)
      Sets the ClassLoader used to find DiffEvaluator service providers.
      ModelDiff.Result compare()
      Performs the diff of the old and new models.
      ModelDiff.Builder newModel​(software.amazon.smithy.model.Model newModel)
      Sets the new model to compare against.
      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.
      ModelDiff.Builder oldModel​(software.amazon.smithy.model.Model oldModel)
      Sets the old model to compare against.
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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​(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:
        java.lang.IllegalStateException - if oldModel and newModel are not set.