Class StringTrait

java.lang.Object
software.amazon.smithy.model.traits.AbstractTrait
software.amazon.smithy.model.traits.StringTrait
All Implemented Interfaces:
FromSourceLocation, ToNode, ToShapeId, Trait
Direct Known Subclasses:
ActionNameTrait, ActionPermissionDescriptionTrait, ApiKeySourceTrait, AuthorizerTrait, CfnMutabilityTrait, CfnNameTrait, ConditionKeyValueTrait, DataTrait, DocumentationTrait, Ec2QueryNameTrait, ErrorTrait, HttpHeaderTrait, HttpPrefixHeadersTrait, HttpQueryTrait, JsonNameTrait, MediaTypeTrait, PatternTrait, PublishTrait, RequestValidatorTrait, ResourceIdentifierTrait, SinceTrait, SubscribeTrait, TimestampFormatTrait, TitleTrait, XmlNameTrait

public abstract class StringTrait extends AbstractTrait
Abstract trait class for traits that contain only a string value.
  • Constructor Details

    • StringTrait

      public StringTrait(ShapeId id, String value, FromSourceLocation sourceLocation)
      Parameters:
      id - The ID of the trait being created.
      value - The string value of the trait.
      sourceLocation - Where the trait was defined.
  • Method Details

    • getValue

      public String getValue()
      Returns:
      Get the trait value.
    • createNode

      protected final 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.