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 java.lang.Object implements SmithyBuilder<TracingSymbolProvider>
Builder to create a TracingSymbolProvider instance.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TracingSymbolProvider.Builder
artifactDefinitions(ArtifactDefinitions artifactDefinitions)
Sets this Builder's ArtifactDefinitions.TracingSymbolProvider
build()
Builds aTracingSymbolProvider
implementation.TracingSymbolProvider.Builder
metadata(TraceMetadata metadata)
Sets this Builder's TraceMetadata.TracingSymbolProvider.Builder
setTraceMetadataAsDefault(java.lang.String artifactType)
Sets the Builder'sTraceMetadata
based on the given type and default values for other required fields.TracingSymbolProvider.Builder
shapeLinkCreator(java.util.function.BiFunction<Shape,Symbol,java.util.List<ShapeLink>> shapeLinkCreator)
Sets this Builder's shapeLinkCreator.TracingSymbolProvider.Builder
symbolProvider(SymbolProvider symbolProvider)
Sets this Builder's SymbolProvider.
-
-
-
Method Detail
-
artifactDefinitions
public TracingSymbolProvider.Builder artifactDefinitions(ArtifactDefinitions artifactDefinitions)
Sets this Builder's ArtifactDefinitions.- Parameters:
artifactDefinitions
- ArtifactDefinitions for this TracingSymbolProvider's TraceFile.- Returns:
- This Builder.
-
metadata
public TracingSymbolProvider.Builder metadata(TraceMetadata metadata)
Sets this Builder's TraceMetadata.- Parameters:
metadata
- TraceMetadata for this TracingSymbolProvider's TraceFile.- Returns:
- This Builder.
-
setTraceMetadataAsDefault
public TracingSymbolProvider.Builder setTraceMetadataAsDefault(java.lang.String artifactType)
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(java.util.function.BiFunction<Shape,Symbol,java.util.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
public TracingSymbolProvider.Builder symbolProvider(SymbolProvider symbolProvider)
Sets this Builder's SymbolProvider.- Parameters:
symbolProvider
- The SymbolProvider that the TracingSymbolProvider will decorate.- Returns:
- This Builder.
-
build
public TracingSymbolProvider build()
Builds aTracingSymbolProvider
implementation.- Specified by:
build
in interfaceSmithyBuilder<TracingSymbolProvider>
- Returns:
- Built TracingSymbolProvider.
-
-