Skip to content

Commit 9602fc3

Browse files
Protocol Buffer TeamLogofile
Protocol Buffer Team
authored andcommitted
This documentation change includes the following:
* Fixes a code samples in the Java Generated Code topic * Adds V30 content to the Migration Guide PiperOrigin-RevId: 734676582 Change-Id: I809481af6eb8f9f4b4af9a7fd98b23315a29951e
1 parent d376eda commit 9602fc3

File tree

2 files changed

+604
-34
lines changed

2 files changed

+604
-34
lines changed

content/reference/java/java-generated.md

+9-8
Original file line numberDiff line numberDiff line change
@@ -587,23 +587,24 @@ The values of this enum type have the following special methods:
587587
The compiler will generate the following accessor methods in both the message
588588
class and its builder:
589589

590-
- `boolean hasFooInt()`: Returns `true` if the oneof case is `FOO`.
590+
- `boolean hasFooInt()`: Returns `true` if the oneof case is `FOO_INT`.
591591
- `int getFooInt()`: Returns the current value of `foo` if the oneof case is
592-
`FOO`. Otherwise, returns the default value of this field.
592+
`FOO_INT`. Otherwise, returns the default value of this field.
593593
- `ChoiceCase getChoiceCase()`: Returns the enum indicating which field is
594594
set. Returns `CHOICE_NOT_SET` if none of them is set.
595595

596596
The compiler will generate the following methods only in the message's builder:
597597

598598
- `Builder setFooInt(int value)`: Sets `Foo` to this value and sets the oneof
599-
case to `FOO`. After calling this, `hasFooInt()` will return `true`,
600-
`getFooInt()` will return `value` and `getChoiceCase()` will return `FOO`.
599+
case to `FOO_INT`. After calling this, `hasFooInt()` will return `true`,
600+
`getFooInt()` will return `value` and `getChoiceCase()` will return
601+
`FOO_INT`.
601602
- `Builder clearFooInt()`:
602-
- Nothing will be changed if the oneof case is not `FOO`.
603-
- If the oneof case is `FOO`, sets `Foo` to null and the oneof case to
604-
`FOO_NOT_SET`. After calling this, `hasFooInt()` will return `false`,
603+
- Nothing will be changed if the oneof case is not `FOO_INT`.
604+
- If the oneof case is `FOO_INT`, sets `Foo` to null and the oneof case to
605+
`CHOICE_NOT_SET`. After calling this, `hasFooInt()` will return `false`,
605606
`getFooInt()` will return the default value and `getChoiceCase()` will
606-
return `FOO_NOT_SET`.
607+
return `CHOICE_NOT_SET`.
607608
- `Builder.clearChoice()`: Resets the value for `choice`, returning the
608609
builder.
609610

0 commit comments

Comments
 (0)