Class 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.

    • 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 class AbstractTrait
        Returns:
        Returns the trait as a node.