Class OriginalShapeIdTrait
java.lang.Object
software.amazon.smithy.model.traits.AbstractTrait
software.amazon.smithy.model.traits.synthetic.OriginalShapeIdTrait
- All Implemented Interfaces:
FromSourceLocation
,ToNode
,ToShapeId
,Trait
Used to provide the original shape ID of a shape that is renamed
in the semantic model.
This is a synthetic trait that is not defined in the semantic model, nor is it persisted when the model is serialized.
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.smithy.model.traits.AbstractTrait
AbstractTrait.Provider
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Node
The result of toNode is used for hashCodes and equality.Gets the original shape ID of the shape before it was renamed.boolean
Checks if this trait is persisted with the shape, or if it is a synthetic, or transient trait, only meant to temporarily aid in some kind of in-memory model transformation.Methods inherited from class software.amazon.smithy.model.traits.AbstractTrait
equals, getSourceLocation, hashCode, setNodeCache, toNode, toShapeId, toString
-
Field Details
-
ID
-
-
Constructor Details
-
OriginalShapeIdTrait
-
-
Method Details
-
getOriginalId
Gets the original shape ID of the shape before it was renamed.- Returns:
- Returns the shape original shape ID.
-
isSynthetic
public boolean isSynthetic()Description copied from interface:Trait
Checks if this trait is persisted with the shape, or if it is a synthetic, or transient trait, only meant to temporarily aid in some kind of in-memory model transformation.Because synthetic traits are not persisted with shapes, they also do not need to be defined in Smithy's semantic model before they can be used in the model.
- Returns:
- Returns true if the trait is not persisted on the shape.
-
createNode
Description copied from class:AbstractTrait
The result of toNode is used for hashCodes and equality. Subclasses must implement createNode to turn the trait into a Node. This is then cached for subsequent retrievals.- Specified by:
createNode
in classAbstractTrait
- Returns:
- Returns the trait as a node.
-