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