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

# Class CBVariantCase

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

All Implemented Interfaces:
  `CBFieldOwnerType`, `CBVariantCaseType`

public final class CBVariantCase extends Object implements CBVariantCaseType
A variant case.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CBVariantCase(String inName)`
  Construct a case.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addField(CBField field)`
  Add a field to the case.
  `List<String>`
  `documentation()`
  `List<CBFieldType>`
  `fields()`
  `String`
  `name()`
  `CBVariantType`
  `owner()`
  `void`
  `setDocumentation(List<String> text)`
  Set the documentation for the case.
  `void`
  `setOwner(CBTypeDeclarationVariant newOwner)`
  Set the owner of the variant case.

  ### 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`

- ## Constructor Details

  - ### CBVariantCase

    public CBVariantCase(String inName)
    Construct a case.
    Parameters:
      `inName` - The case name

- ## Method Details

  - ### addField

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

  - ### fields

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

  - ### owner

    public CBVariantType owner()
    Specified by:
      `owner` in interface `CBVariantCaseType`
    Returns:
      The type within which this case is declared

  - ### name

    public String name()
    Specified by:
      `name` in interface `CBVariantCaseType`
    Returns:
      The name of the variant case

  - ### documentation

    public List<String> documentation()
    Specified by:
      `documentation` in interface `CBVariantCaseType`
    Returns:
      The documentation for the case

  - ### setOwner

    public void setOwner(CBTypeDeclarationVariant newOwner)
    Set the owner of the variant case.
    Parameters:
      `newOwner` - The owner

  - ### setDocumentation

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