public final class TraceFile extends java.lang.Object implements ToNode, ToSmithyBuilder<TraceFile>
TraceMetadata
, and
Map
from ShapeId
to a List of ShapeLink
objects. TraceFile's
optionally have a ArtifactDefinitions
object. TraceFile handles parsing, serialization
and deserialization of a Smithy trace file.Modifier and Type | Class and Description |
---|---|
static class |
TraceFile.Builder
Builder for constructing TraceFile's from scratch.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFINITIONS_TEXT |
static java.lang.String |
METADATA_TEXT |
static java.lang.String |
SHAPES_TEXT |
static java.lang.String |
SMITHY_TRACE_TEXT |
static java.lang.String |
SMITHY_TRACE_VERSION |
Modifier and Type | Method and Description |
---|---|
static TraceFile.Builder |
builder() |
static TraceFile |
fromNode(Node value)
Converts ObjectNode into TraceFile.
|
java.util.Optional<ArtifactDefinitions> |
getArtifactDefinitions()
Gets this TraceFile's Definitions.
|
TraceMetadata |
getMetadata()
Gets this TraceFile's TraceMetadata.
|
java.util.Map<ShapeId,java.util.List<ShapeLink>> |
getShapes()
Gets this TraceFile's Shapes map.
|
java.lang.String |
getSmithyTrace()
Gets this TraceFile's smithyTrace.
|
TraceFile.Builder |
toBuilder()
Take this object and create a builder that contains all of the
current property values of this object.
|
ObjectNode |
toNode()
Converts TraceFile instance variables into an
ObjectNode.
|
void |
validateModel(Model model)
Parses model and determines whether the trace file object meets the specs of the model by checking if
the trace file contains all the ShapeIds in the model and the model contains all the ShapeIDs in the trace file.
|
public static final java.lang.String SMITHY_TRACE_TEXT
public static final java.lang.String METADATA_TEXT
public static final java.lang.String DEFINITIONS_TEXT
public static final java.lang.String SHAPES_TEXT
public static final java.lang.String SMITHY_TRACE_VERSION
public static TraceFile fromNode(Node value)
value
- an ObjectNode that represents the entire trace file.public static TraceFile.Builder builder()
public ObjectNode toNode()
public void validateModel(Model model)
model
- the Smithy model to validate the trace file against.ExpectationNotMetException
- if model contains a ShapeID not in TraceFile or TraceFile contains a ShapeID
not in model.public java.lang.String getSmithyTrace()
String
contains the Smithy trace file version number.public TraceMetadata getMetadata()
public java.util.Optional<ArtifactDefinitions> getArtifactDefinitions()
public java.util.Map<ShapeId,java.util.List<ShapeLink>> getShapes()
Map
provides a mapping of absolute Smithy shape IDs to a list
of shape link objects. A single Smithy shape can be responsible for generating
multiple components in the target artifact.public TraceFile.Builder toBuilder()
toBuilder
in interface ToSmithyBuilder<TraceFile>