generateOneofAccessors method

void generateOneofAccessors(
  1. IndentingWriter out,
  2. OneofNames oneof
)

Implementation

void generateOneofAccessors(IndentingWriter out, OneofNames oneof) {
  out.println();
  out.println('${oneof.oneofEnumName} ${oneof.whichOneofMethodName}() '
      '=> ${oneof.byTagMapName}[\$_whichOneof(${oneof.index})]!;');
  out.println('void ${oneof.clearMethodName}() '
      '=> clearField(\$_whichOneof(${oneof.index}));');
}