OneofGen
Emits a proto oneof as a nested Scala 3 enum.
This is the shape that makes a oneof pleasant to use: exhaustive matching, no "which getter is valid" question, and an explicit Empty case instead of a null.
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
Members list
Value members
Concrete methods
The case name for one member.
The case name for one member.
A field actually called empty would otherwise collide with the Empty case, so it gets a trailing underscore rather than a compile error in generated code.
Attributes
getFieldByNumber arms: Some only while that member's case is active.
getFieldByNumber arms: Some only while that member's case is active.
Attributes
Parse arms, keyed by tag.
Parse arms, keyed by tag.
A message-typed member merges with the previous value when the same case repeats, which is protobuf's rule for a singular message field appearing twice.
Attributes
Sizes the active case, if any. A oneof member is written even when it is the default.
Sizes the active case, if any. A oneof member is written even when it is the default.
Attributes
One guarded write per member, keyed by field number.
One guarded write per member, keyed by field number.
Per member rather than one match, so the enclosing message can interleave them with its other fields in field-number order. A oneof's members need not be contiguous.