Class TraceMetadata
- java.lang.Object
-
- software.amazon.smithy.codegen.core.trace.TraceMetadata
-
- All Implemented Interfaces:
ToNode
,ToSmithyBuilder<TraceMetadata>
public final class TraceMetadata extends java.lang.Object implements ToNode, ToSmithyBuilder<TraceMetadata>
Class that defines information a code-generated artifact.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TraceMetadata.Builder
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
HOMEPAGE_TEXT
static java.lang.String
ID_TEXT
static java.lang.String
TIMESTAMP_TEXT
static java.lang.String
TYPE_TEXT
static java.lang.String
TYPE_VERSION_TEXT
static java.lang.String
VERSION_TEXT
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TraceMetadata.Builder
builder()
static TraceMetadata
fromNode(Node value)
Instantiates TraceMetadata instance variables using an ObjectNode that contains the artifact section of the trace file.java.util.Optional<java.lang.String>
getHomepage()
Gets this TraceMetadata's Homepage in an Optional container.java.lang.String
getId()
Gets this TraceMetadata's id.java.lang.String
getTimestamp()
Gets this TraceMetadata's timestamp.java.lang.String
getType()
Gets this TraceMetadata's type.java.util.Optional<java.lang.String>
getTypeVersion()
Gets this TraceMetadata's TypeVersion in an Optional container.java.lang.String
getVersion()
Gets this TraceMetadata's version (for example, the AWS SDK release number).TraceMetadata.Builder
toBuilder()
Take this object and create a builder that contains all of the current property values of this object.ObjectNode
toNode()
Converts the metadata contained in TraceMetadata's variables into an ObjectNode.
-
-
-
Field Detail
-
ID_TEXT
public static final java.lang.String ID_TEXT
- See Also:
- Constant Field Values
-
VERSION_TEXT
public static final java.lang.String VERSION_TEXT
- See Also:
- Constant Field Values
-
TYPE_TEXT
public static final java.lang.String TYPE_TEXT
- See Also:
- Constant Field Values
-
TYPE_VERSION_TEXT
public static final java.lang.String TYPE_VERSION_TEXT
- See Also:
- Constant Field Values
-
HOMEPAGE_TEXT
public static final java.lang.String HOMEPAGE_TEXT
- See Also:
- Constant Field Values
-
TIMESTAMP_TEXT
public static final java.lang.String TIMESTAMP_TEXT
- See Also:
- Constant Field Values
-
-
Method Detail
-
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.
-
getId
public java.lang.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 java.lang.String getVersion()
Gets this TraceMetadata's version (for example, the AWS SDK release number).- Returns:
- TraceMetadata's version
-
getTimestamp
public java.lang.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 java.lang.String getType()
Gets this TraceMetadata's type. For code generation, this is the programming language.- Returns:
- TraceMetadata's type
-
getTypeVersion
public java.util.Optional<java.lang.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 java.util.Optional<java.lang.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 interfaceToSmithyBuilder<TraceMetadata>
- Returns:
- a builder for type T
-
-