Package software.amazon.smithy.diff
Class ModelDiff.Builder
- java.lang.Object
-
- software.amazon.smithy.diff.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 findDiffEvaluator
service providers.ModelDiff.Result
compare()
Performs the diff of the old and new models.ModelDiff.Builder
newModel(Model newModel)
Sets the new model to compare against.ModelDiff.Builder
newModel(ValidatedResult<Model> newModel)
Sets the new model to compare against along with the validation events encountered while loading the model.ModelDiff.Builder
oldModel(Model oldModel)
Sets the old model to compare against.ModelDiff.Builder
oldModel(ValidatedResult<Model> oldModel)
Sets the old model to compare against along with the validation events encountered while loading the model.
-
-
-
Method Detail
-
classLoader
public ModelDiff.Builder classLoader(java.lang.ClassLoader classLoader)
Sets the ClassLoader used to findDiffEvaluator
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
- ifoldModel
andnewModel
are not set.
-
-