Class IdxTrait

java.lang.Object
software.amazon.smithy.model.traits.AbstractTrait
software.amazon.smithy.protocol.traits.IdxTrait
All Implemented Interfaces:
FromSourceLocation, ToNode, ToShapeId, Trait

public final class IdxTrait extends AbstractTrait
Defines the stable wire index of a structure or union member.
  • Field Details

    • ID

      public static final ShapeId ID
  • Constructor Details

    • IdxTrait

      public IdxTrait(int value, FromSourceLocation sourceLocation)
      Parameters:
      value - Index value.
      sourceLocation - Where the trait was defined.
    • IdxTrait

      public IdxTrait(int value)
      Parameters:
      value - Index value.
  • Method Details

    • getValue

      public int getValue()
      Gets the index value.
      Returns:
      Returns the index value.
    • 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.