Package com.io7m.cedarbridge.schema.compiled.internal

# Class CBPackageBuilder

java.lang.Object
com.io7m.cedarbridge.schema.compiled.internal.CBPackageBuilder

All Implemented Interfaces:
  `CBPackageBuilderType`

public final class CBPackageBuilder extends Object implements CBPackageBuilderType
A package builder.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CBPackageBuilder(String inPackageName)`
  Construct a package builder.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `CBPackageBuilderType`
  `addImport(CBPackageType imported)`
  Import a package.
  `CBPackageType`
  `build()`
  Build a package based on all of the given values so far.
  `CBTypeDeclarationBuilderType`
  `createExternalType(String inExternalPackageName, String inExternalName, String inTypeName)`
  Create a new external type declaration.
  `CBProtocolBuilderType`
  `createProtocol(String name)`
  Create a new protocol.
  `CBRecordBuilderType`
  `createRecord(String name)`
  Create a new record.
  `CBVariantBuilderType`
  `createVariant(String name)`
  Create a new variant.
  `CBRecordBuilderType`
  `findRecord(String name)`
  Find an existing record.
  `CBTypeDeclarationBuilderType`
  `findType(String name)`
  Find an existing type.
  `CBVariantBuilderType`
  `findVariant(String name)`
  Find an existing variant.
  `CBTypeExpressionType.CBTypeExprNamedType`
  `referenceExternalType(CBTypeDeclarationType typeDeclaration)`
  Reference an external type.
  `CBTypeExpressionType.CBTypeExprNamedType`
  `referenceType(String name)`
  Reference an existing type.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### CBPackageBuilder

    public CBPackageBuilder(String inPackageName)
    Construct a package builder.
    Parameters:
      `inPackageName` - The package name

- ## Method Details

  - ### createExternalType

    public CBTypeDeclarationBuilderType createExternalType(String inExternalPackageName, String inExternalName, String inTypeName)
    Description copied from interface: `CBPackageBuilderType`
    Create a new external type declaration.
    Specified by:
      `createExternalType` in interface `CBPackageBuilderType`
    Parameters:
      `inExternalPackageName` - The external package name
      `inExternalName` - The external type name
      `inTypeName` - The name within this package
    Returns:
      A type declaration builder

  - ### createRecord

    public CBRecordBuilderType createRecord(String name)
    Description copied from interface: `CBPackageBuilderType`
    Create a new record.
    Specified by:
      `createRecord` in interface `CBPackageBuilderType`
    Parameters:
      `name` - The name within this package
    Returns:
      A record builder

  - ### findRecord

    public CBRecordBuilderType findRecord(String name)
    Description copied from interface: `CBPackageBuilderType`
    Find an existing record.
    Specified by:
      `findRecord` in interface `CBPackageBuilderType`
    Parameters:
      `name` - The name within this package
    Returns:
      A record builder

  - ### createVariant

    public CBVariantBuilderType createVariant(String name)
    Description copied from interface: `CBPackageBuilderType`
    Create a new variant.
    Specified by:
      `createVariant` in interface `CBPackageBuilderType`
    Parameters:
      `name` - The name within this package
    Returns:
      A variant builder

  - ### findVariant

    public CBVariantBuilderType findVariant(String name)
    Description copied from interface: `CBPackageBuilderType`
    Find an existing variant.
    Specified by:
      `findVariant` in interface `CBPackageBuilderType`
    Parameters:
      `name` - The name within this package
    Returns:
      A record builder

  - ### findType

    public CBTypeDeclarationBuilderType findType(String name)
    Description copied from interface: `CBPackageBuilderType`
    Find an existing type.
    Specified by:
      `findType` in interface `CBPackageBuilderType`
    Parameters:
      `name` - The name within this package
    Returns:
      A type builder

  - ### referenceType

    public CBTypeExpressionType.CBTypeExprNamedType referenceType(String name)
    Description copied from interface: `CBPackageBuilderType`
    Reference an existing type.
    Specified by:
      `referenceType` in interface `CBPackageBuilderType`
    Parameters:
      `name` - The name within this package
    Returns:
      A named type expression

  - ### referenceExternalType

    public CBTypeExpressionType.CBTypeExprNamedType referenceExternalType(CBTypeDeclarationType typeDeclaration)
    Description copied from interface: `CBPackageBuilderType`
    Reference an external type.
    Specified by:
      `referenceExternalType` in interface `CBPackageBuilderType`
    Parameters:
      `typeDeclaration` - The type declaration
    Returns:
      A named type expression

  - ### build

    public CBPackageType build()
    Description copied from interface: `CBPackageBuilderType`
    Build a package based on all of the given values so far.
    Specified by:
      `build` in interface `CBPackageBuilderType`
    Returns:
      A package

  - ### addImport

    public CBPackageBuilderType addImport(CBPackageType imported)
    Description copied from interface: `CBPackageBuilderType`
    Import a package.
    Specified by:
      `addImport` in interface `CBPackageBuilderType`
    Parameters:
      `imported` - The package
    Returns:
      this

  - ### createProtocol

    public CBProtocolBuilderType createProtocol(String name)
    Description copied from interface: `CBPackageBuilderType`
    Create a new protocol.
    Specified by:
      `createProtocol` in interface `CBPackageBuilderType`
    Parameters:
      `name` - The name within this package
    Returns:
      A protocol builder