Class HttpErrorTrait

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

public final class HttpErrorTrait extends AbstractTrait
Defines a custom HTTP status code for error structures.
  • Field Details

    • ID

      public static final ShapeId ID
  • Constructor Details

    • HttpErrorTrait

      public HttpErrorTrait(int code, FromSourceLocation sourceLocation)
    • HttpErrorTrait

      public HttpErrorTrait(int code)
  • Method Details

    • getCode

      public int getCode()
    • 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.