Class Snippet.Builder
java.lang.Object
software.amazon.smithy.codegen.core.docs.Snippet.Builder
- All Implemented Interfaces:
SmithyBuilder<Snippet>
- Enclosing class:
- Snippet
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddFile(SnippetFile file) Adds a file to the snippet.build()Creates an immutable object that is created from the properties that have been set on the builder.files(Collection<SnippetFile> files) Sets the files that make up the snippet.Sets the protocol of the snippet.Sets the target id of the snippet.Sets the title of the snippet.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
build
Description copied from interface:SmithyBuilderCreates an immutable object that is created from the properties that have been set on the builder.- Specified by:
buildin interfaceSmithyBuilder<Snippet>- Returns:
- an instance of T
-
targetId
Sets the target id of the snippet.- Parameters:
id- The id to set as the target of the snippet.- Returns:
- Returns the builder.
-
title
Sets the title of the snippet.- Parameters:
title- The title to set for the snippet.- Returns:
- Returns the builder.
-
protocol
Sets the protocol of the snippet.To remove the protocol, set a null value.
- Parameters:
protocol- The shape id of the protocol the snippet is tied to.- Returns:
- Returns the builder.
-
files
Sets the files that make up the snippet.- Parameters:
files- A list of files that make up the snippet.- Returns:
- Returns the builder.
-
addFile
Adds a file to the snippet.- Parameters:
file- A file to add to the snippet.- Returns:
- Returns the builder.
-