Annotation Type BoundChoice


Identifies that the annotation target is a bound property that participates in a Metaschema choice.

A choice represents mutually exclusive alternatives in a Metaschema model. Fields with the same choiceId() are part of the same choice and exactly one of them must be provided when the choice is required.

This is distinct from BoundChoiceGroup, which represents a polymorphic collection with a type discriminator.

Adjacency requirement: All fields with the same choiceId must be declared consecutively in the class, reflecting the Metaschema model where choice alternatives occupy the same position in the serialization order.

  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Identifies which choice this field belongs to.
  • Element Details

    • choiceId

      @NonNull String choiceId
      Identifies which choice this field belongs to.

      Fields with the same choiceId are mutually exclusive alternatives. The choiceId must be unique within the containing assembly and consistent across all alternatives in the choice.

      Returns:
      the choice identifier