Class Selector.ShapeMatch

java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<String,Set<Shape>>
software.amazon.smithy.model.selector.Selector.ShapeMatch
All Implemented Interfaces:
Serializable, Cloneable, Map<String,Set<Shape>>
Enclosing interface:
Selector

public static final class Selector.ShapeMatch extends HashMap<String,Set<Shape>>
Represents a selector match found in the model.

The getShape method is used to get the shape that matched, and all of the contextual variables that were set when the match occurred can be accessed using typical Map methods like get, contains, etc.

See Also:
  • Constructor Details

    • ShapeMatch

      public ShapeMatch(Shape shape, Map<String,Set<Shape>> variables)
      Parameters:
      shape - Shape that matched.
      variables - Variables that matched. This map is copied into ShapeMatch.
  • Method Details

    • getShape

      public Shape getShape()
      Gets the matching shape.
      Returns:
      Returns the matching shape.