diff options
author | Feng Xiao <xfxyjwf@gmail.com> | 2014-11-10 17:34:54 -0800 |
---|---|---|
committer | Feng Xiao <xfxyjwf@gmail.com> | 2014-11-10 17:34:54 -0800 |
commit | 6ef984af4b0c63c1c33127a12dcfc8e6359f0c9e (patch) | |
tree | d17c61ff9f3ae28224fbddac6d26bfc59e2cf755 /python/google/protobuf/message.py | |
parent | baca1a8a1aa180c42de6278d3b8286c4496c6a10 (diff) | |
download | protobuf-6ef984af4b0c63c1c33127a12dcfc8e6359f0c9e.tar.gz protobuf-6ef984af4b0c63c1c33127a12dcfc8e6359f0c9e.tar.bz2 protobuf-6ef984af4b0c63c1c33127a12dcfc8e6359f0c9e.zip |
Down-integrate from internal code base.
Diffstat (limited to 'python/google/protobuf/message.py')
-rwxr-xr-x | python/google/protobuf/message.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/python/google/protobuf/message.py b/python/google/protobuf/message.py index c186452a..88ed9f4c 100755 --- a/python/google/protobuf/message.py +++ b/python/google/protobuf/message.py @@ -233,12 +233,21 @@ class Message(object): raise NotImplementedError def HasField(self, field_name): - """Checks if a certain field is set for the message. Note if the - field_name is not defined in the message descriptor, ValueError will be - raised.""" + """Checks if a certain field is set for the message, or if any field inside + a oneof group is set. Note that if the field_name is not defined in the + message descriptor, ValueError will be raised.""" raise NotImplementedError def ClearField(self, field_name): + """Clears the contents of a given field, or the field set inside a oneof + group. If the name neither refers to a defined field or oneof group, + ValueError is raised.""" + raise NotImplementedError + + def WhichOneof(self, oneof_group): + """Returns the name of the field that is set inside a oneof group, or + None if no field is set. If no group with the given name exists, ValueError + will be raised.""" raise NotImplementedError def HasExtension(self, extension_handle): |