Class Differences.Builder

java.lang.Object
software.amazon.smithy.diff.Differences.Builder
All Implemented Interfaces:
software.amazon.smithy.utils.SmithyBuilder<Differences>
Enclosing class:
Differences

public static final class Differences.Builder extends Object implements software.amazon.smithy.utils.SmithyBuilder<Differences>
A Builder for Differences.

For most uses of Differences, it should be constructed with Differences.detect(software.amazon.smithy.model.Model, software.amazon.smithy.model.Model).

This is intended to be used for evaluating subsets of the models or synthetic differences between them. For example, two completely different shapes could be evaluated against each other to see what the differences are.

  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • build

      public Differences build()
      Specified by:
      build in interface software.amazon.smithy.utils.SmithyBuilder<Differences>
    • oldModel

      public Differences.Builder oldModel(software.amazon.smithy.model.Model oldModel)
      Sets the model to be used as the base model.
      Parameters:
      oldModel - The model to base changes on.
      Returns:
      Returns the builder.
    • newModel

      public Differences.Builder newModel(software.amazon.smithy.model.Model newModel)
      Sets the model to be used as the new model state.
      Parameters:
      newModel - The model to use as the new state.
      Returns:
      Returns the builder.
    • addedShapes

      public Differences.Builder addedShapes(Collection<software.amazon.smithy.model.shapes.Shape> addedShapes)
      Sets what shapes have been added.

      For most uses, detectShapeChanges() or Differences.detect(Model, Model) should be used instead.

      Parameters:
      addedShapes - The shapes to consider as having been added.
      Returns:
      Returns the builder.
    • removedShapes

      public Differences.Builder removedShapes(Collection<software.amazon.smithy.model.shapes.Shape> removedShapes)
      Sets what shapes have been removed.

      For most uses, detectShapeChanges() or Differences.detect(Model, Model) should be used instead.

      Parameters:
      removedShapes - The shapes to consider as having been removed.
      Returns:
      Returns the builder.
    • changedShapes

      public Differences.Builder changedShapes(Collection<ChangedShape<software.amazon.smithy.model.shapes.Shape>> changedShapes)
      Sets what shapes have been changed.

      For most uses, detectShapeChanges() or Differences.detect(Model, Model) should be used instead.

      Parameters:
      changedShapes - The shapes to consider as having changed.
      Returns:
      Returns the builder.
    • changedShape

      public Differences.Builder changedShape(ChangedShape<software.amazon.smithy.model.shapes.Shape> changedShape)
      Adds a shape to the set of shapes that have been changed.

      For most uses, detectShapeChanges() or Differences.detect(Model, Model) should be used instead.

      Parameters:
      changedShape - A shape to consider as having changed.
      Returns:
      Returns the builder.
    • addedMetadata

      public Differences.Builder addedMetadata(Collection<software.amazon.smithy.utils.Pair<String,software.amazon.smithy.model.node.Node>> addedMetadata)
      Sets the metadata that is considered to have been added.

      For most uses, detectMetadataChanges() or Differences.detect(Model, Model) should be used instead.

      Parameters:
      addedMetadata - The metadata to consider as having been added.
      Returns:
      Returns the builder.
    • removedMetadata

      public Differences.Builder removedMetadata(Collection<software.amazon.smithy.utils.Pair<String,software.amazon.smithy.model.node.Node>> removedMetadata)
      Sets the metadata that is considered to have been removed.

      For most uses, detectMetadataChanges() or Differences.detect(Model, Model) should be used instead.

      Parameters:
      removedMetadata - The metadata to consider as having been removed.
      Returns:
      Returns the builder.
    • changedMetadata

      public Differences.Builder changedMetadata(Collection<ChangedMetadata> changedMetadata)
      Sets the metadata that is considered to have been changed.

      For most uses, detectMetadataChanges() or Differences.detect(Model, Model) should be used instead.

      Parameters:
      changedMetadata - The metadata to consider as having been changed.
      Returns:
      Returns the builder.
    • detectShapeChanges

      public Differences.Builder detectShapeChanges()
      Detects all shape additions, removals, and changes.
      Returns:
      Returns the builder.
    • detectMetadataChanges

      public Differences.Builder detectMetadataChanges()
      Detects all metadata additions, removals, and changes.
      Returns:
      Returns the builder.