aboutsummaryrefslogtreecommitdiff
path: root/python/google/protobuf/message.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/google/protobuf/message.py')
-rwxr-xr-xpython/google/protobuf/message.py15
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):