Class TracingSymbolProvider.Builder
java.lang.Object
software.amazon.smithy.codegen.core.trace.TracingSymbolProvider.Builder
- All Implemented Interfaces:
SmithyBuilder<TracingSymbolProvider>
- Enclosing class:
- TracingSymbolProvider
public static final class TracingSymbolProvider.Builder
extends Object
implements SmithyBuilder<TracingSymbolProvider>
Builder to create a TracingSymbolProvider instance.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionartifactDefinitions
(ArtifactDefinitions artifactDefinitions) Sets this Builder's ArtifactDefinitions.build()
Builds aTracingSymbolProvider
implementation.metadata
(TraceMetadata metadata) Sets this Builder's TraceMetadata.setTraceMetadataAsDefault
(String artifactType) Sets the Builder'sTraceMetadata
based on the given type and default values for other required fields.shapeLinkCreator
(BiFunction<Shape, Symbol, List<ShapeLink>> shapeLinkCreator) Sets this Builder's shapeLinkCreator.symbolProvider
(SymbolProvider symbolProvider) Sets this Builder's SymbolProvider.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
artifactDefinitions
Sets this Builder's ArtifactDefinitions.- Parameters:
artifactDefinitions
- ArtifactDefinitions for this TracingSymbolProvider's TraceFile.- Returns:
- This Builder.
-
metadata
Sets this Builder's TraceMetadata.- Parameters:
metadata
- TraceMetadata for this TracingSymbolProvider's TraceFile.- Returns:
- This Builder.
-
setTraceMetadataAsDefault
Sets the Builder'sTraceMetadata
based on the given type and default values for other required fields. This method should ONLY be used when the version, type, homepage, and typeVersion of the TraceMetadata object is unknown at the time of code generation. This method will ONLY set the required fields of theTraceMetadata
.The type is set to the artifactType that is passed in. The artifactType is the code language of the generated artifact, e.g. Java.
The timestamp in TraceMetadata is set to the current time when the method is called.
The id and version are set to a UUID that should be changed after the TraceFile is constructed and the correct id and version are known.
- Parameters:
artifactType
- The type, i.e. language, of the TraceMetadata object.- Returns:
- This Builder.
-
shapeLinkCreator
public TracingSymbolProvider.Builder shapeLinkCreator(BiFunction<Shape, Symbol, List<ShapeLink>> shapeLinkCreator) Sets this Builder's shapeLinkCreator. The shapeLinkCreator is a function that maps from a Symbol to a List of ShapeLinks. Custom Functions should be designed for each code generator that map apply the tags and types in the definitions files to specific ShapeLinks.- Parameters:
shapeLinkCreator
- A Function that defines a mapping from a Symbol to a List of ShapeLinks.- Returns:
- This Builder.
-
symbolProvider
Sets this Builder's SymbolProvider.- Parameters:
symbolProvider
- The SymbolProvider that the TracingSymbolProvider will decorate.- Returns:
- This Builder.
-
build
Builds aTracingSymbolProvider
implementation.- Specified by:
build
in interfaceSmithyBuilder<TracingSymbolProvider>
- Returns:
- Built TracingSymbolProvider.
-