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

# Class CBPackage

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

All Implemented Interfaces:
  `CBPackageType`

public final class CBPackage extends Object implements CBPackageType
A package declaration.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CBPackage(String inName)`
  Construct a package.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addExternal(CBTypeDeclarationExternal external)`
  Add an external type to the package.
  `void`
  `addImport(CBPackageType imported)`
  Add an import to the package.
  `void`
  `addProtocol(CBProtocolDeclaration protocol)`
  Add a protocol to the package.
  `void`
  `addRecord(CBTypeDeclarationRecord record)`
  Add a record to the package.
  `void`
  `addVariant(CBTypeDeclarationVariant variant)`
  Add a variant to the package.
  `List<CBPackageType>`
  `imports()`
  `String`
  `name()`
  `Map<String,CBProtocolDeclarationType>`
  `protocols()`
  `Map<String,CBTypeDeclarationType>`
  `types()`

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

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

  ### Methods inherited from interface com.io7m.cedarbridge.schema.compiled.CBPackageType

  `protocolVersionsForType`

- ## Constructor Details

  - ### CBPackage

    public CBPackage(String inName)
    Construct a package.
    Parameters:
      `inName` - The name

- ## Method Details

  - ### addImport

    public void addImport(CBPackageType imported)
    Add an import to the package.
    Parameters:
      `imported` - The imported package

  - ### addProtocol

    public void addProtocol(CBProtocolDeclaration protocol)
    Add a protocol to the package.
    Parameters:
      `protocol` - The protocol

  - ### addRecord

    public void addRecord(CBTypeDeclarationRecord record)
    Add a record to the package.
    Parameters:
      `record` - The record

  - ### addVariant

    public void addVariant(CBTypeDeclarationVariant variant)
    Add a variant to the package.
    Parameters:
      `variant` - The variant

  - ### addExternal

    public void addExternal(CBTypeDeclarationExternal external)
    Add an external type to the package.
    Parameters:
      `external` - The external type

  - ### name

    public String name()
    Specified by:
      `name` in interface `CBPackageType`
    Returns:
      The full name of the package, such as `com.io7m.cedarbridge`

  - ### imports

    public List<CBPackageType> imports()
    Specified by:
      `imports` in interface `CBPackageType`
    Returns:
      The packages imported by this package

  - ### types

    public Map<String,CBTypeDeclarationType> types()
    Specified by:
      `types` in interface `CBPackageType`
    Returns:
      The types declared within this package

  - ### protocols

    public Map<String,CBProtocolDeclarationType> protocols()
    Specified by:
      `protocols` in interface `CBPackageType`
    Returns:
      The protocols declared within this package