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
public final class OriginalShapeIdTrait extends AbstractTrait
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
-
-
Constructor Summary
Constructors Constructor Description OriginalShapeIdTrait(ShapeId original)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Node
createNode()
The result of toNode is used for hashCodes and equality.ShapeId
getOriginalId()
Gets the original shape ID of the shape before it was renamed.boolean
isSynthetic()
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 Detail
-
ID
public static final ShapeId ID
-
-
Constructor Detail
-
OriginalShapeIdTrait
public OriginalShapeIdTrait(ShapeId original)
-
-
Method Detail
-
getOriginalId
public ShapeId 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
protected Node 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.
-
-