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

# Class CBTypeDeclarationRecord

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

All Implemented Interfaces:
  `CBFieldOwnerType`, `CBRecordType`, `CBTypeDeclarationType`

public final class CBTypeDeclarationRecord extends Object implements CBRecordType
A record type declaration.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CBTypeDeclarationRecord(String inName)`
  Construct a type declaration.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addField(CBField field)`
  Add a field.
  `void`
  `addTypeParameter(CBTypeParameter parameter)`
  Add a type parameter.
  `List<String>`
  `documentation()`
  `Optional<CBExternalName>`
  `external()`
  `List<CBFieldType>`
  `fields()`
  `String`
  `name()`
  `CBPackageType`
  `owner()`
  `List<CBTypeParameterType>`
  `parameters()`
  `void`
  `setDocumentation(List<String> text)`
  Set the documentation.
  `void`
  `setExternalName(String newExternalPackage, String newExternalName)`
  Set the external name.
  `void`
  `setOwner(CBPackage newOwner)`
  Set the owner.

  ### 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.CBFieldOwnerType

  `fieldsByName`

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

  `id`

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

  `arity, idForType, parametersByName`

- ## Constructor Details

  - ### CBTypeDeclarationRecord

    public CBTypeDeclarationRecord(String inName)
    Construct a type declaration.
    Parameters:
      `inName` - The type name

- ## Method Details

  - ### addTypeParameter

    public void addTypeParameter(CBTypeParameter parameter)
    Add a type parameter.
    Parameters:
      `parameter` - The parameter

  - ### addField

    public void addField(CBField field)
    Add a field.
    Parameters:
      `field` - The field

  - ### setExternalName

    public void setExternalName(String newExternalPackage, String newExternalName)
    Set the external name.
    Parameters:
      `newExternalPackage` - The external package
      `newExternalName` - The external name

  - ### fields

    public List<CBFieldType> fields()
    Specified by:
      `fields` in interface `CBFieldOwnerType`
    Returns:
      The fields of the record in declaration order

  - ### owner

    public CBPackageType owner()
    Specified by:
      `owner` in interface `CBTypeDeclarationType`
    Returns:
      The package that owns this declaration

  - ### name

    public String name()
    Specified by:
      `name` in interface `CBTypeDeclarationType`
    Returns:
      The package-unique declaration name

  - ### parameters

    public List<CBTypeParameterType> parameters()
    Specified by:
      `parameters` in interface `CBTypeDeclarationType`
    Returns:
      The type parameters, if any, in declaration order

  - ### external

    public Optional<CBExternalName> external()
    Specified by:
      `external` in interface `CBTypeDeclarationType`
    Returns:
      The external name, if any

  - ### documentation

    public List<String> documentation()
    Specified by:
      `documentation` in interface `CBTypeDeclarationType`
    Returns:
      Documentation for the type declaration

  - ### setOwner

    public void setOwner(CBPackage newOwner)
    Set the owner.
    Parameters:
      `newOwner` - The new owner

  - ### setDocumentation

    public void setDocumentation(List<String> text)
    Set the documentation.
    Parameters:
      `text` - The text