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

# Class CBTypeDeclarationVariant

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

All Implemented Interfaces:
  `CBTypeDeclarationType`, `CBVariantType`

public final class CBTypeDeclarationVariant extends Object implements CBVariantType
A variant type declaration.

- ## Constructor Summary

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addCase(CBVariantCase caseV)`
  Add a variant case.
  `void`
  `addTypeParameter(CBTypeParameter parameter)`
  Add a type parameter.
  `List<CBVariantCaseType>`
  `cases()`
  `List<String>`
  `documentation()`
  `Optional<CBExternalName>`
  `external()`
  `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.CBTypeDeclarationType

  `arity, idForType, parametersByName`

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

  `casesByName, id`

- ## Constructor Details

  - ### CBTypeDeclarationVariant

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

- ## Method Details

  - ### addTypeParameter

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

  - ### addCase

    public void addCase(CBVariantCase caseV)
    Add a variant case.
    Parameters:
      `caseV` - The case

  - ### setExternalName

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

  - ### cases

    public List<CBVariantCaseType> cases()
    Specified by:
      `cases` in interface `CBVariantType`
    Returns:
      The cases of the variant type 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