Class Snippet
java.lang.Object
software.amazon.smithy.codegen.core.docs.Snippet
- All Implemented Interfaces:
ToSmithyBuilder<Snippet>
Represents a generated snippet, potentially containing multiple logical files.
Snippets are generated code based on some trait or other shared definition,
such as the ExamplesTrait. These are
created by code generators and consumed by documentation tools, such as
smithy-docgen.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic Snippet.Builderbuilder()booleangetFiles()Gets the identifier of what the snippet was generated for.getTitle()Gets the title of the snippet.inthashCode()Take this object and create a builder that contains all of the current property values of this object.
-
Method Details
-
getTargetId
Gets the identifier of what the snippet was generated for.If this snippet represents a generated example from the
ExamplesTrait, this will be the title of the example.- Returns:
- Returns the target identifier of the snippet.
-
getTitle
Gets the title of the snippet.This is distinct from the target ID as it identifies the specific snippet.
Generally, the title should reflect the primary language of the snippet, such as "Python" for a Python snippet.
- Returns:
- Returns the title of the snippet.
-
getProtocol
- Returns:
- Optionally returns the ShapeId of the protocol associated with this snippet.
-
getFiles
- Returns:
- Returns the files that comprise the snippet.
-
equals
-
hashCode
public int hashCode() -
toBuilder
Description copied from interface:ToSmithyBuilderTake this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilderin interfaceToSmithyBuilder<Snippet>- Returns:
- a builder for type T
-
builder
- Returns:
- Returns a new Snippet builder.
-