Class TraceMetadata

java.lang.Object
software.amazon.smithy.codegen.core.trace.TraceMetadata
All Implemented Interfaces:
ToNode, ToSmithyBuilder<TraceMetadata>

public final class TraceMetadata extends Object implements ToNode, ToSmithyBuilder<TraceMetadata>
Class that defines information a code-generated artifact.
  • Field Details

  • Method Details

    • fromNode

      public static TraceMetadata fromNode(Node value)
      Instantiates TraceMetadata instance variables using an ObjectNode that contains the artifact section of the trace file.
      Parameters:
      value - an ObjectNode that contains all children of the artifact tag in the trace file
      Returns:
      TraceMetadata produced by deserializing the node.
    • builder

      public static TraceMetadata.Builder builder()
    • toNode

      public ObjectNode toNode()
      Converts the metadata contained in TraceMetadata's variables into an ObjectNode.
      Specified by:
      toNode in interface ToNode
      Returns:
      an ObjectNode with that contains StringNodes representing the trace file metadata
    • getId

      public String getId()
      Gets this TraceMetadata's id. The id is the identifier of the artifact. For example, Java packages should use the Maven artifact ID.
      Returns:
      TraceMetadata's id
    • getVersion

      public String getVersion()
      Gets this TraceMetadata's version (for example, the AWS SDK release number).
      Returns:
      TraceMetadata's version
    • getTimestamp

      public String getTimestamp()
      Gets this TraceMetadata's timestamp. The timestamp is the RFC 3339 date and time that the artifact was created.
      Returns:
      TraceMetadata's timestamp
    • getType

      public String getType()
      Gets this TraceMetadata's type. For code generation, this is the programming language.
      Returns:
      TraceMetadata's type
    • getTypeVersion

      public Optional<String> getTypeVersion()
      Gets this TraceMetadata's TypeVersion in an Optional container. For example, when defining trace files for Java source code, the typeVersion would be the minimum supported JDK version. Different artifacts may have different output based on the version targets (for example the ability to use more features in a newer version of a language).
      Returns:
      Optional container with type version or empty container if TypeVersion has not been set.
    • getHomepage

      public Optional<String> getHomepage()
      Gets this TraceMetadata's Homepage in an Optional container. The homepage is the homepage URL of the artifact.
      Returns:
      Optional container with homepage or empty container if homepage has not been set
    • toBuilder

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