diff options
author | Ulas Kirazci <ulas@google.com> | 2013-07-29 18:22:16 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2013-07-29 18:22:16 +0000 |
commit | 064b60c65938dbdb45b1377975cee8a104e6d62b (patch) | |
tree | 51bf9bf0b8b6c39eeedd3dbb042da2f28ccbce5b /java/README.txt | |
parent | a91e2fc467033f975211e8d88582a3d706ee862d (diff) | |
parent | e83bbbbe4213e9b7bcc0529c305b821da8d7a136 (diff) | |
download | protobuf-064b60c65938dbdb45b1377975cee8a104e6d62b.tar.gz protobuf-064b60c65938dbdb45b1377975cee8a104e6d62b.tar.bz2 protobuf-064b60c65938dbdb45b1377975cee8a104e6d62b.zip |
Merge "Add an option to inspect "has" state upon parse."
Diffstat (limited to 'java/README.txt')
-rw-r--r-- | java/README.txt | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/java/README.txt b/java/README.txt index dac2e3c9..58ccb88e 100644 --- a/java/README.txt +++ b/java/README.txt @@ -301,6 +301,22 @@ message's constructor or clear() function is called, the default value penalty. This is not a problem if the field has no default or is an empty default. +Nano Generator options + +java_nano_generate_has: + If true, generates a public boolean variable has<fieldname> + accompanying the optional or required field (not present for + repeated fields, groups or messages). It is set to false initially + and upon clear(). If parseFrom(...) reads the field from the wire, + it is set to true. This is a way for clients to inspect the "has" + value upon parse. If it is set to true, writeTo(...) will ALWAYS + output that field (even if field value is equal to its + default). + + IMPORTANT: This option costs an extra 4 bytes per primitive field in + the message. Think carefully about whether you really need this. In + many cases reading the default works and determining whether the + field was received over the wire is irrelevant. To use nano protobufs: |