Class ShapeClosure
java.lang.Object
software.amazon.smithy.model.metadata.ShapeClosure
- All Implemented Interfaces:
FromSourceLocation,ToNode,ToSmithyBuilder<ShapeClosure>
public final class ShapeClosure
extends Object
implements ToNode, ToSmithyBuilder<ShapeClosure>, FromSourceLocation
A named closure of shapes.
This is defined in the model as an entry in the shapeClosures list.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe metadata key under which a list of shape closures is stored. -
Method Summary
Modifier and TypeMethodDescriptionstatic ShapeClosure.Builderbuilder()Creates a builder for aShapeClosure.booleanstatic Map<String,ShapeClosure> Extracts every well-formedshapeClosuresentry from model metadata.static Map<String,ShapeClosure> Extracts everyshapeClosuresentry from a model's metadata.static ShapeClosureCreates aShapeClosurefrom a single closure node.Gets the documentation for the closure.getId()Gets the identifier used to refer to this closure.Gets the selector whose matched shapes are included in the closure.Gets the namespaces whose shapes are included in the closure.Gets the shape renames applied within the closure.Gets the source location of a value.inthashCode()Take this object and create a builder that contains all of the current property values of this object.toNode()Converts a value to aNode.
-
Field Details
-
METADATA_KEY
The metadata key under which a list of shape closures is stored.- See Also:
-
-
Method Details
-
builder
Creates a builder for aShapeClosure.- Returns:
- the created builder.
-
fromNode
Creates aShapeClosurefrom a single closure node.- Parameters:
node- Object node to parse.- Returns:
- the parsed closure.
-
fromModel
Extracts everyshapeClosuresentry from a model's metadata.- Parameters:
model- Model to read theshapeClosuresmetadata from.- Returns:
- an ordered map of closure id to closure, empty if none are defined.
-
fromModel
Extracts every well-formedshapeClosuresentry from model metadata.Entries that cannot be parsed (for example, a missing id or a malformed rename key) are skipped; those problems are reported separately by model validation.
- Parameters:
metadata- Model metadata to read theshapeClosuresentry from.- Returns:
- an ordered map of closure id to closure, empty if none are defined.
-
getId
Gets the identifier used to refer to this closure.- Returns:
- the closure id.
-
getIncludeNamespaces
Gets the namespaces whose shapes are included in the closure.- Returns:
- the included namespaces, or an empty set if none are defined.
-
getIncludeBySelector
Gets the selector whose matched shapes are included in the closure.- Returns:
- the selector expression, or empty if none is defined.
-
getRename
Gets the shape renames applied within the closure.Each key is the id of a shape in the closure, and each value is the name, without a namespace, to use for that shape within the closure.
- Returns:
- a map of shape id to replacement name, empty if none are defined.
-
getDocumentation
Gets the documentation for the closure.- Returns:
- the documentation for the closure.
-
getSourceLocation
Description copied from interface:FromSourceLocationGets the source location of a value.- Specified by:
getSourceLocationin interfaceFromSourceLocation- Returns:
- Returns the source location of the value.
-
toNode
Description copied from interface:ToNodeConverts a value to aNode. -
toBuilder
Description copied from interface:ToSmithyBuilderTake this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilderin interfaceToSmithyBuilder<ShapeClosure>- Returns:
- a builder for type T
-
equals
-
hashCode
public int hashCode()
-