forked from protocolbuffers/protobuf
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FieldDescriptor.HasPresence returns true if both ClearValue and HasValue (on the accessor) can be expected to work. Some fields have a working ClearValue, but no HasValue; HasPresence returns false for those fields. Generally: - Extension fields have presence if and only if they're singular - Repeated fields do not support presence - Map fields do not support presence - Message fields support presence - Oneof fields support presence (this includes synthetic oneof fields, so that covers proto3 optional singular fields) - Proto2 singular primitive fields support presence - Proto3 singular primitive fields do not support presence (unless they're in a oneof, covered above)
- Loading branch information
Showing
4 changed files
with
221 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters