Class UnstableTrait

java.lang.Object
software.amazon.smithy.model.traits.AbstractTrait
software.amazon.smithy.model.traits.UnstableTrait
All Implemented Interfaces:
FromSourceLocation, ToNode, ToShapeId, Trait, ToSmithyBuilder<UnstableTrait>

public final class UnstableTrait extends AbstractTrait implements ToSmithyBuilder<UnstableTrait>
Indicates that a shape is unstable and could change in the future.

An optional feature id associates the shape with a preview feature defined by the enclosing service's unstableFeatures trait.

See Also:
  • Field Details

    • ID

      public static final ShapeId ID
  • Constructor Details

    • UnstableTrait

      public UnstableTrait(ObjectNode node)
    • UnstableTrait

      public UnstableTrait()
  • Method Details

    • getFeatureId

      public Optional<String> getFeatureId()
      Gets the id of the unstable feature this shape belongs to, if any.
      Returns:
      Returns the optional feature id.
    • 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.
    • toBuilder

      public UnstableTrait.Builder toBuilder()
      Description copied from interface: ToSmithyBuilder
      Take this object and create a builder that contains all of the current property values of this object.
      Specified by:
      toBuilder in interface ToSmithyBuilder<UnstableTrait>
      Returns:
      a builder for type T
    • builder

      public static UnstableTrait.Builder builder()