Class Symbol.Builder

java.lang.Object
software.amazon.smithy.codegen.core.Symbol.Builder
All Implemented Interfaces:
SmithyBuilder<Symbol>
Enclosing class:
Symbol

public static final class Symbol.Builder extends Object implements SmithyBuilder<Symbol>
Builds a Symbol.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • build

      public Symbol build()
      Description copied from interface: SmithyBuilder
      Creates an immutable object that is created from the properties that have been set on the builder.
      Specified by:
      build in interface SmithyBuilder<Symbol>
      Returns:
      an instance of T
    • name

      public Symbol.Builder name(String name)
      Sets the unqualified name of the symbol.
      Parameters:
      name - Name to set.
      Returns:
      Returns the builder.
    • namespace

      public Symbol.Builder namespace(String namespace, String namespaceDelimiter)
      Sets the namespace and namespace delimiter of the symbol.
      Parameters:
      namespace - Namespace to set.
      namespaceDelimiter - Namespace delimiter to set.
      Returns:
      Returns the builder.
    • definitionFile

      public Symbol.Builder definitionFile(String definitionFile)
      Sets the filename of where this symbol is defined.

      This value defaults to the value provided for declarationFile if not present. One of a definitionFile or a declarationFile must be provided for every Symbol.

      Parameters:
      definitionFile - Filename of where the symbol is defined.
      Returns:
      Returns the builder.
    • declarationFile

      public Symbol.Builder declarationFile(String declarationFile)
      Sets the filename of where this symbol is declared.

      This value defaults to the value provided for definitionFile if not present. One of a definitionFile or a declarationFile must be provided for every Symbol.

      Parameters:
      declarationFile - Filename of where the symbol is declared.
      Returns:
      Returns the builder.
    • references

      public Symbol.Builder references(List<SymbolReference> references)
      Replaces the symbol references to the symbol.
      Parameters:
      references - References to set.
      Returns:
      Returns the builder.
    • addReference

      public Symbol.Builder addReference(Symbol reference)
      Add a symbol reference to indicate that this symbol points to or contains references to other symbols.
      Parameters:
      reference - Symbol that is referenced.
      Returns:
      Returns the builder.
    • addReference

      public Symbol.Builder addReference(SymbolReference reference)
      Add a symbol reference to indicate that this symbol points to or contains references to other symbols.
      Parameters:
      reference - Symbol reference to add.
      Returns:
      Returns the builder.
    • dependencies

      public Symbol.Builder dependencies(List<SymbolDependency> dependencies)
      Replaces the symbol dependencies of the symbol.
      Parameters:
      dependencies - Dependencies to set.
      Returns:
      Returns the builder.
    • dependencies

      public Symbol.Builder dependencies(SymbolDependencyContainer container)
      Replaces the symbol dependencies of the symbol.
      Parameters:
      container - Dependencies to set.
      Returns:
      Returns the builder.
    • addDependency

      public Symbol.Builder addDependency(SymbolDependencyContainer dependency)
      Add a symbol dependency.
      Parameters:
      dependency - Symbol dependency to add.
      Returns:
      Returns the builder.
    • addDependency

      public Symbol.Builder addDependency(String packageName, String version)
      Add a symbol dependency.
      Parameters:
      packageName - Name of the package to depend on.
      version - Version to depend on.
      Returns:
      Returns the builder.
    • addDependency

      public Symbol.Builder addDependency(String dependencyType, String packageName, String version)
      Add a symbol dependency.
      Parameters:
      dependencyType - Type of dependency.
      packageName - Name of the package to depend on.
      version - Version to depend on.
      Returns:
      Returns the builder.
    • putProperty

      public Symbol.Builder putProperty(String key, Object value)
      Sets a specific custom property.
      Parameters:
      key - Key to set.
      value - Value to set.
      Returns:
      Returns the builder.
    • removeProperty

      public Symbol.Builder removeProperty(String key)
      Removes a specific custom property.
      Parameters:
      key - Key to remove.
      Returns:
      Returns the builder.
    • properties

      public Symbol.Builder properties(Map<String,Object> properties)
      Replaces all of the custom properties.
      Parameters:
      properties - Custom properties to replace with.
      Returns:
      Returns the builder.