From c4a6b8791df08aded61d763d7c3103ee54ce10ae Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Fri, 18 May 2012 11:20:11 -0400 Subject: [PATCH] Not versioning the generated stuff after all not least because it screws up my language metrics :-) --- protobuf/gen/cc/tutorial/addressbook.pb.cc | 1090 ---------- protobuf/gen/cc/tutorial/addressbook.pb.h | 752 ------- protobuf/gen/java/tutorial/addressbook.java | 2137 ------------------- protobuf/gen/py/tutorial/addressbook_pb2.py | 223 -- 4 files changed, 4202 deletions(-) delete mode 100644 protobuf/gen/cc/tutorial/addressbook.pb.cc delete mode 100644 protobuf/gen/cc/tutorial/addressbook.pb.h delete mode 100644 protobuf/gen/java/tutorial/addressbook.java delete mode 100644 protobuf/gen/py/tutorial/addressbook_pb2.py diff --git a/protobuf/gen/cc/tutorial/addressbook.pb.cc b/protobuf/gen/cc/tutorial/addressbook.pb.cc deleted file mode 100644 index 50f0a05..0000000 --- a/protobuf/gen/cc/tutorial/addressbook.pb.cc +++ /dev/null @@ -1,1090 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! - -#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION -#include "addressbook.pb.h" - -#include - -#include -#include -#include -#include -#include -#include -// @@protoc_insertion_point(includes) - -namespace tutorial { - -namespace { - -const ::google::protobuf::Descriptor* Person_descriptor_ = NULL; -const ::google::protobuf::internal::GeneratedMessageReflection* - Person_reflection_ = NULL; -const ::google::protobuf::Descriptor* Person_PhoneNumber_descriptor_ = NULL; -const ::google::protobuf::internal::GeneratedMessageReflection* - Person_PhoneNumber_reflection_ = NULL; -const ::google::protobuf::EnumDescriptor* Person_PhoneType_descriptor_ = NULL; -const ::google::protobuf::Descriptor* AddressBook_descriptor_ = NULL; -const ::google::protobuf::internal::GeneratedMessageReflection* - AddressBook_reflection_ = NULL; -const ::google::protobuf::EnumDescriptor* Gender_descriptor_ = NULL; - -} // namespace - - -void protobuf_AssignDesc_addressbook_2eproto() { - protobuf_AddDesc_addressbook_2eproto(); - const ::google::protobuf::FileDescriptor* file = - ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName( - "addressbook.proto"); - GOOGLE_CHECK(file != NULL); - Person_descriptor_ = file->message_type(0); - static const int Person_offsets_[5] = { - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Person, name_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Person, id_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Person, email_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Person, type_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Person, phone_), - }; - Person_reflection_ = - new ::google::protobuf::internal::GeneratedMessageReflection( - Person_descriptor_, - Person::default_instance_, - Person_offsets_, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Person, _has_bits_[0]), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Person, _unknown_fields_), - -1, - ::google::protobuf::DescriptorPool::generated_pool(), - ::google::protobuf::MessageFactory::generated_factory(), - sizeof(Person)); - Person_PhoneNumber_descriptor_ = Person_descriptor_->nested_type(0); - static const int Person_PhoneNumber_offsets_[2] = { - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Person_PhoneNumber, number_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Person_PhoneNumber, type_), - }; - Person_PhoneNumber_reflection_ = - new ::google::protobuf::internal::GeneratedMessageReflection( - Person_PhoneNumber_descriptor_, - Person_PhoneNumber::default_instance_, - Person_PhoneNumber_offsets_, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Person_PhoneNumber, _has_bits_[0]), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Person_PhoneNumber, _unknown_fields_), - -1, - ::google::protobuf::DescriptorPool::generated_pool(), - ::google::protobuf::MessageFactory::generated_factory(), - sizeof(Person_PhoneNumber)); - Person_PhoneType_descriptor_ = Person_descriptor_->enum_type(0); - AddressBook_descriptor_ = file->message_type(1); - static const int AddressBook_offsets_[1] = { - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AddressBook, person_), - }; - AddressBook_reflection_ = - new ::google::protobuf::internal::GeneratedMessageReflection( - AddressBook_descriptor_, - AddressBook::default_instance_, - AddressBook_offsets_, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AddressBook, _has_bits_[0]), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AddressBook, _unknown_fields_), - -1, - ::google::protobuf::DescriptorPool::generated_pool(), - ::google::protobuf::MessageFactory::generated_factory(), - sizeof(AddressBook)); - Gender_descriptor_ = file->enum_type(0); -} - -namespace { - -GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_); -inline void protobuf_AssignDescriptorsOnce() { - ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_, - &protobuf_AssignDesc_addressbook_2eproto); -} - -void protobuf_RegisterTypes(const ::std::string&) { - protobuf_AssignDescriptorsOnce(); - ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( - Person_descriptor_, &Person::default_instance()); - ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( - Person_PhoneNumber_descriptor_, &Person_PhoneNumber::default_instance()); - ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( - AddressBook_descriptor_, &AddressBook::default_instance()); -} - -} // namespace - -void protobuf_ShutdownFile_addressbook_2eproto() { - delete Person::default_instance_; - delete Person_reflection_; - delete Person_PhoneNumber::default_instance_; - delete Person_PhoneNumber_reflection_; - delete AddressBook::default_instance_; - delete AddressBook_reflection_; -} - -void protobuf_AddDesc_addressbook_2eproto() { - static bool already_here = false; - if (already_here) return; - already_here = true; - GOOGLE_PROTOBUF_VERIFY_VERSION; - - ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( - "\n\021addressbook.proto\022\010tutorial\"\200\002\n\006Person" - "\022\014\n\004name\030\001 \002(\t\022\n\n\002id\030\002 \002(\005\022\r\n\005email\030\003 \001(" - "\t\022$\n\004type\030\004 \001(\0162\020.tutorial.Gender:\004NONE\022" - "+\n\005phone\030\005 \003(\0132\034.tutorial.Person.PhoneNu" - "mber\032M\n\013PhoneNumber\022\016\n\006number\030\001 \002(\t\022.\n\004t" - "ype\030\002 \001(\0162\032.tutorial.Person.PhoneType:\004H" - "OME\"+\n\tPhoneType\022\n\n\006MOBILE\020\000\022\010\n\004HOME\020\001\022\010" - "\n\004WORK\020\002\"/\n\013AddressBook\022 \n\006person\030\001 \003(\0132" - "\020.tutorial.Person*3\n\006Gender\022\010\n\004NONE\020\000\022\010\n" - "\004MALE\020\001\022\n\n\006FEMALE\020\002\022\t\n\005OTHER\020\003", 390); - ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( - "addressbook.proto", &protobuf_RegisterTypes); - Person::default_instance_ = new Person(); - Person_PhoneNumber::default_instance_ = new Person_PhoneNumber(); - AddressBook::default_instance_ = new AddressBook(); - Person::default_instance_->InitAsDefaultInstance(); - Person_PhoneNumber::default_instance_->InitAsDefaultInstance(); - AddressBook::default_instance_->InitAsDefaultInstance(); - ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_addressbook_2eproto); -} - -// Force AddDescriptors() to be called at static initialization time. -struct StaticDescriptorInitializer_addressbook_2eproto { - StaticDescriptorInitializer_addressbook_2eproto() { - protobuf_AddDesc_addressbook_2eproto(); - } -} static_descriptor_initializer_addressbook_2eproto_; - -const ::google::protobuf::EnumDescriptor* Gender_descriptor() { - protobuf_AssignDescriptorsOnce(); - return Gender_descriptor_; -} -bool Gender_IsValid(int value) { - switch(value) { - case 0: - case 1: - case 2: - case 3: - return true; - default: - return false; - } -} - - -// =================================================================== - -const ::google::protobuf::EnumDescriptor* Person_PhoneType_descriptor() { - protobuf_AssignDescriptorsOnce(); - return Person_PhoneType_descriptor_; -} -bool Person_PhoneType_IsValid(int value) { - switch(value) { - case 0: - case 1: - case 2: - return true; - default: - return false; - } -} - -#ifndef _MSC_VER -const Person_PhoneType Person::MOBILE; -const Person_PhoneType Person::HOME; -const Person_PhoneType Person::WORK; -const Person_PhoneType Person::PhoneType_MIN; -const Person_PhoneType Person::PhoneType_MAX; -const int Person::PhoneType_ARRAYSIZE; -#endif // _MSC_VER -#ifndef _MSC_VER -const int Person_PhoneNumber::kNumberFieldNumber; -const int Person_PhoneNumber::kTypeFieldNumber; -#endif // !_MSC_VER - -Person_PhoneNumber::Person_PhoneNumber() - : ::google::protobuf::Message() { - SharedCtor(); -} - -void Person_PhoneNumber::InitAsDefaultInstance() { -} - -Person_PhoneNumber::Person_PhoneNumber(const Person_PhoneNumber& from) - : ::google::protobuf::Message() { - SharedCtor(); - MergeFrom(from); -} - -void Person_PhoneNumber::SharedCtor() { - _cached_size_ = 0; - number_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); - type_ = 1; - ::memset(_has_bits_, 0, sizeof(_has_bits_)); -} - -Person_PhoneNumber::~Person_PhoneNumber() { - SharedDtor(); -} - -void Person_PhoneNumber::SharedDtor() { - if (number_ != &::google::protobuf::internal::kEmptyString) { - delete number_; - } - if (this != default_instance_) { - } -} - -void Person_PhoneNumber::SetCachedSize(int size) const { - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); -} -const ::google::protobuf::Descriptor* Person_PhoneNumber::descriptor() { - protobuf_AssignDescriptorsOnce(); - return Person_PhoneNumber_descriptor_; -} - -const Person_PhoneNumber& Person_PhoneNumber::default_instance() { - if (default_instance_ == NULL) protobuf_AddDesc_addressbook_2eproto(); return *default_instance_; -} - -Person_PhoneNumber* Person_PhoneNumber::default_instance_ = NULL; - -Person_PhoneNumber* Person_PhoneNumber::New() const { - return new Person_PhoneNumber; -} - -void Person_PhoneNumber::Clear() { - if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { - if (has_number()) { - if (number_ != &::google::protobuf::internal::kEmptyString) { - number_->clear(); - } - } - type_ = 1; - } - ::memset(_has_bits_, 0, sizeof(_has_bits_)); - mutable_unknown_fields()->Clear(); -} - -bool Person_PhoneNumber::MergePartialFromCodedStream( - ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!(EXPRESSION)) return false - ::google::protobuf::uint32 tag; - while ((tag = input->ReadTag()) != 0) { - switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // required string number = 1; - case 1: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->mutable_number())); - ::google::protobuf::internal::WireFormat::VerifyUTF8String( - this->number().data(), this->number().length(), - ::google::protobuf::internal::WireFormat::PARSE); - } else { - goto handle_uninterpreted; - } - if (input->ExpectTag(16)) goto parse_type; - break; - } - - // optional .tutorial.Person.PhoneType type = 2 [default = HOME]; - case 2: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { - parse_type: - int value; - DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< - int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( - input, &value))); - if (::tutorial::Person_PhoneType_IsValid(value)) { - set_type(static_cast< ::tutorial::Person_PhoneType >(value)); - } else { - mutable_unknown_fields()->AddVarint(2, value); - } - } else { - goto handle_uninterpreted; - } - if (input->ExpectAtEnd()) return true; - break; - } - - default: { - handle_uninterpreted: - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - return true; - } - DO_(::google::protobuf::internal::WireFormat::SkipField( - input, tag, mutable_unknown_fields())); - break; - } - } - } - return true; -#undef DO_ -} - -void Person_PhoneNumber::SerializeWithCachedSizes( - ::google::protobuf::io::CodedOutputStream* output) const { - // required string number = 1; - if (has_number()) { - ::google::protobuf::internal::WireFormat::VerifyUTF8String( - this->number().data(), this->number().length(), - ::google::protobuf::internal::WireFormat::SERIALIZE); - ::google::protobuf::internal::WireFormatLite::WriteString( - 1, this->number(), output); - } - - // optional .tutorial.Person.PhoneType type = 2 [default = HOME]; - if (has_type()) { - ::google::protobuf::internal::WireFormatLite::WriteEnum( - 2, this->type(), output); - } - - if (!unknown_fields().empty()) { - ::google::protobuf::internal::WireFormat::SerializeUnknownFields( - unknown_fields(), output); - } -} - -::google::protobuf::uint8* Person_PhoneNumber::SerializeWithCachedSizesToArray( - ::google::protobuf::uint8* target) const { - // required string number = 1; - if (has_number()) { - ::google::protobuf::internal::WireFormat::VerifyUTF8String( - this->number().data(), this->number().length(), - ::google::protobuf::internal::WireFormat::SERIALIZE); - target = - ::google::protobuf::internal::WireFormatLite::WriteStringToArray( - 1, this->number(), target); - } - - // optional .tutorial.Person.PhoneType type = 2 [default = HOME]; - if (has_type()) { - target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( - 2, this->type(), target); - } - - if (!unknown_fields().empty()) { - target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( - unknown_fields(), target); - } - return target; -} - -int Person_PhoneNumber::ByteSize() const { - int total_size = 0; - - if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { - // required string number = 1; - if (has_number()) { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::StringSize( - this->number()); - } - - // optional .tutorial.Person.PhoneType type = 2 [default = HOME]; - if (has_type()) { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::EnumSize(this->type()); - } - - } - if (!unknown_fields().empty()) { - total_size += - ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( - unknown_fields()); - } - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = total_size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); - return total_size; -} - -void Person_PhoneNumber::MergeFrom(const ::google::protobuf::Message& from) { - GOOGLE_CHECK_NE(&from, this); - const Person_PhoneNumber* source = - ::google::protobuf::internal::dynamic_cast_if_available( - &from); - if (source == NULL) { - ::google::protobuf::internal::ReflectionOps::Merge(from, this); - } else { - MergeFrom(*source); - } -} - -void Person_PhoneNumber::MergeFrom(const Person_PhoneNumber& from) { - GOOGLE_CHECK_NE(&from, this); - if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { - if (from.has_number()) { - set_number(from.number()); - } - if (from.has_type()) { - set_type(from.type()); - } - } - mutable_unknown_fields()->MergeFrom(from.unknown_fields()); -} - -void Person_PhoneNumber::CopyFrom(const ::google::protobuf::Message& from) { - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void Person_PhoneNumber::CopyFrom(const Person_PhoneNumber& from) { - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool Person_PhoneNumber::IsInitialized() const { - if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false; - - return true; -} - -void Person_PhoneNumber::Swap(Person_PhoneNumber* other) { - if (other != this) { - std::swap(number_, other->number_); - std::swap(type_, other->type_); - std::swap(_has_bits_[0], other->_has_bits_[0]); - _unknown_fields_.Swap(&other->_unknown_fields_); - std::swap(_cached_size_, other->_cached_size_); - } -} - -::google::protobuf::Metadata Person_PhoneNumber::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - ::google::protobuf::Metadata metadata; - metadata.descriptor = Person_PhoneNumber_descriptor_; - metadata.reflection = Person_PhoneNumber_reflection_; - return metadata; -} - - -// ------------------------------------------------------------------- - -#ifndef _MSC_VER -const int Person::kNameFieldNumber; -const int Person::kIdFieldNumber; -const int Person::kEmailFieldNumber; -const int Person::kTypeFieldNumber; -const int Person::kPhoneFieldNumber; -#endif // !_MSC_VER - -Person::Person() - : ::google::protobuf::Message() { - SharedCtor(); -} - -void Person::InitAsDefaultInstance() { -} - -Person::Person(const Person& from) - : ::google::protobuf::Message() { - SharedCtor(); - MergeFrom(from); -} - -void Person::SharedCtor() { - _cached_size_ = 0; - name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); - id_ = 0; - email_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); - type_ = 0; - ::memset(_has_bits_, 0, sizeof(_has_bits_)); -} - -Person::~Person() { - SharedDtor(); -} - -void Person::SharedDtor() { - if (name_ != &::google::protobuf::internal::kEmptyString) { - delete name_; - } - if (email_ != &::google::protobuf::internal::kEmptyString) { - delete email_; - } - if (this != default_instance_) { - } -} - -void Person::SetCachedSize(int size) const { - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); -} -const ::google::protobuf::Descriptor* Person::descriptor() { - protobuf_AssignDescriptorsOnce(); - return Person_descriptor_; -} - -const Person& Person::default_instance() { - if (default_instance_ == NULL) protobuf_AddDesc_addressbook_2eproto(); return *default_instance_; -} - -Person* Person::default_instance_ = NULL; - -Person* Person::New() const { - return new Person; -} - -void Person::Clear() { - if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { - if (has_name()) { - if (name_ != &::google::protobuf::internal::kEmptyString) { - name_->clear(); - } - } - id_ = 0; - if (has_email()) { - if (email_ != &::google::protobuf::internal::kEmptyString) { - email_->clear(); - } - } - type_ = 0; - } - phone_.Clear(); - ::memset(_has_bits_, 0, sizeof(_has_bits_)); - mutable_unknown_fields()->Clear(); -} - -bool Person::MergePartialFromCodedStream( - ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!(EXPRESSION)) return false - ::google::protobuf::uint32 tag; - while ((tag = input->ReadTag()) != 0) { - switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // required string name = 1; - case 1: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->mutable_name())); - ::google::protobuf::internal::WireFormat::VerifyUTF8String( - this->name().data(), this->name().length(), - ::google::protobuf::internal::WireFormat::PARSE); - } else { - goto handle_uninterpreted; - } - if (input->ExpectTag(16)) goto parse_id; - break; - } - - // required int32 id = 2; - case 2: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { - parse_id: - DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< - ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( - input, &id_))); - set_has_id(); - } else { - goto handle_uninterpreted; - } - if (input->ExpectTag(26)) goto parse_email; - break; - } - - // optional string email = 3; - case 3: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { - parse_email: - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->mutable_email())); - ::google::protobuf::internal::WireFormat::VerifyUTF8String( - this->email().data(), this->email().length(), - ::google::protobuf::internal::WireFormat::PARSE); - } else { - goto handle_uninterpreted; - } - if (input->ExpectTag(32)) goto parse_type; - break; - } - - // optional .tutorial.Gender type = 4 [default = NONE]; - case 4: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { - parse_type: - int value; - DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< - int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( - input, &value))); - if (tutorial::Gender_IsValid(value)) { - set_type(static_cast< tutorial::Gender >(value)); - } else { - mutable_unknown_fields()->AddVarint(4, value); - } - } else { - goto handle_uninterpreted; - } - if (input->ExpectTag(42)) goto parse_phone; - break; - } - - // repeated .tutorial.Person.PhoneNumber phone = 5; - case 5: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { - parse_phone: - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, add_phone())); - } else { - goto handle_uninterpreted; - } - if (input->ExpectTag(42)) goto parse_phone; - if (input->ExpectAtEnd()) return true; - break; - } - - default: { - handle_uninterpreted: - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - return true; - } - DO_(::google::protobuf::internal::WireFormat::SkipField( - input, tag, mutable_unknown_fields())); - break; - } - } - } - return true; -#undef DO_ -} - -void Person::SerializeWithCachedSizes( - ::google::protobuf::io::CodedOutputStream* output) const { - // required string name = 1; - if (has_name()) { - ::google::protobuf::internal::WireFormat::VerifyUTF8String( - this->name().data(), this->name().length(), - ::google::protobuf::internal::WireFormat::SERIALIZE); - ::google::protobuf::internal::WireFormatLite::WriteString( - 1, this->name(), output); - } - - // required int32 id = 2; - if (has_id()) { - ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->id(), output); - } - - // optional string email = 3; - if (has_email()) { - ::google::protobuf::internal::WireFormat::VerifyUTF8String( - this->email().data(), this->email().length(), - ::google::protobuf::internal::WireFormat::SERIALIZE); - ::google::protobuf::internal::WireFormatLite::WriteString( - 3, this->email(), output); - } - - // optional .tutorial.Gender type = 4 [default = NONE]; - if (has_type()) { - ::google::protobuf::internal::WireFormatLite::WriteEnum( - 4, this->type(), output); - } - - // repeated .tutorial.Person.PhoneNumber phone = 5; - for (int i = 0; i < this->phone_size(); i++) { - ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( - 5, this->phone(i), output); - } - - if (!unknown_fields().empty()) { - ::google::protobuf::internal::WireFormat::SerializeUnknownFields( - unknown_fields(), output); - } -} - -::google::protobuf::uint8* Person::SerializeWithCachedSizesToArray( - ::google::protobuf::uint8* target) const { - // required string name = 1; - if (has_name()) { - ::google::protobuf::internal::WireFormat::VerifyUTF8String( - this->name().data(), this->name().length(), - ::google::protobuf::internal::WireFormat::SERIALIZE); - target = - ::google::protobuf::internal::WireFormatLite::WriteStringToArray( - 1, this->name(), target); - } - - // required int32 id = 2; - if (has_id()) { - target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->id(), target); - } - - // optional string email = 3; - if (has_email()) { - ::google::protobuf::internal::WireFormat::VerifyUTF8String( - this->email().data(), this->email().length(), - ::google::protobuf::internal::WireFormat::SERIALIZE); - target = - ::google::protobuf::internal::WireFormatLite::WriteStringToArray( - 3, this->email(), target); - } - - // optional .tutorial.Gender type = 4 [default = NONE]; - if (has_type()) { - target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( - 4, this->type(), target); - } - - // repeated .tutorial.Person.PhoneNumber phone = 5; - for (int i = 0; i < this->phone_size(); i++) { - target = ::google::protobuf::internal::WireFormatLite:: - WriteMessageNoVirtualToArray( - 5, this->phone(i), target); - } - - if (!unknown_fields().empty()) { - target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( - unknown_fields(), target); - } - return target; -} - -int Person::ByteSize() const { - int total_size = 0; - - if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { - // required string name = 1; - if (has_name()) { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::StringSize( - this->name()); - } - - // required int32 id = 2; - if (has_id()) { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::Int32Size( - this->id()); - } - - // optional string email = 3; - if (has_email()) { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::StringSize( - this->email()); - } - - // optional .tutorial.Gender type = 4 [default = NONE]; - if (has_type()) { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::EnumSize(this->type()); - } - - } - // repeated .tutorial.Person.PhoneNumber phone = 5; - total_size += 1 * this->phone_size(); - for (int i = 0; i < this->phone_size(); i++) { - total_size += - ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( - this->phone(i)); - } - - if (!unknown_fields().empty()) { - total_size += - ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( - unknown_fields()); - } - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = total_size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); - return total_size; -} - -void Person::MergeFrom(const ::google::protobuf::Message& from) { - GOOGLE_CHECK_NE(&from, this); - const Person* source = - ::google::protobuf::internal::dynamic_cast_if_available( - &from); - if (source == NULL) { - ::google::protobuf::internal::ReflectionOps::Merge(from, this); - } else { - MergeFrom(*source); - } -} - -void Person::MergeFrom(const Person& from) { - GOOGLE_CHECK_NE(&from, this); - phone_.MergeFrom(from.phone_); - if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { - if (from.has_name()) { - set_name(from.name()); - } - if (from.has_id()) { - set_id(from.id()); - } - if (from.has_email()) { - set_email(from.email()); - } - if (from.has_type()) { - set_type(from.type()); - } - } - mutable_unknown_fields()->MergeFrom(from.unknown_fields()); -} - -void Person::CopyFrom(const ::google::protobuf::Message& from) { - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void Person::CopyFrom(const Person& from) { - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool Person::IsInitialized() const { - if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false; - - for (int i = 0; i < phone_size(); i++) { - if (!this->phone(i).IsInitialized()) return false; - } - return true; -} - -void Person::Swap(Person* other) { - if (other != this) { - std::swap(name_, other->name_); - std::swap(id_, other->id_); - std::swap(email_, other->email_); - std::swap(type_, other->type_); - phone_.Swap(&other->phone_); - std::swap(_has_bits_[0], other->_has_bits_[0]); - _unknown_fields_.Swap(&other->_unknown_fields_); - std::swap(_cached_size_, other->_cached_size_); - } -} - -::google::protobuf::Metadata Person::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - ::google::protobuf::Metadata metadata; - metadata.descriptor = Person_descriptor_; - metadata.reflection = Person_reflection_; - return metadata; -} - - -// =================================================================== - -#ifndef _MSC_VER -const int AddressBook::kPersonFieldNumber; -#endif // !_MSC_VER - -AddressBook::AddressBook() - : ::google::protobuf::Message() { - SharedCtor(); -} - -void AddressBook::InitAsDefaultInstance() { -} - -AddressBook::AddressBook(const AddressBook& from) - : ::google::protobuf::Message() { - SharedCtor(); - MergeFrom(from); -} - -void AddressBook::SharedCtor() { - _cached_size_ = 0; - ::memset(_has_bits_, 0, sizeof(_has_bits_)); -} - -AddressBook::~AddressBook() { - SharedDtor(); -} - -void AddressBook::SharedDtor() { - if (this != default_instance_) { - } -} - -void AddressBook::SetCachedSize(int size) const { - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); -} -const ::google::protobuf::Descriptor* AddressBook::descriptor() { - protobuf_AssignDescriptorsOnce(); - return AddressBook_descriptor_; -} - -const AddressBook& AddressBook::default_instance() { - if (default_instance_ == NULL) protobuf_AddDesc_addressbook_2eproto(); return *default_instance_; -} - -AddressBook* AddressBook::default_instance_ = NULL; - -AddressBook* AddressBook::New() const { - return new AddressBook; -} - -void AddressBook::Clear() { - person_.Clear(); - ::memset(_has_bits_, 0, sizeof(_has_bits_)); - mutable_unknown_fields()->Clear(); -} - -bool AddressBook::MergePartialFromCodedStream( - ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!(EXPRESSION)) return false - ::google::protobuf::uint32 tag; - while ((tag = input->ReadTag()) != 0) { - switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // repeated .tutorial.Person person = 1; - case 1: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { - parse_person: - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, add_person())); - } else { - goto handle_uninterpreted; - } - if (input->ExpectTag(10)) goto parse_person; - if (input->ExpectAtEnd()) return true; - break; - } - - default: { - handle_uninterpreted: - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - return true; - } - DO_(::google::protobuf::internal::WireFormat::SkipField( - input, tag, mutable_unknown_fields())); - break; - } - } - } - return true; -#undef DO_ -} - -void AddressBook::SerializeWithCachedSizes( - ::google::protobuf::io::CodedOutputStream* output) const { - // repeated .tutorial.Person person = 1; - for (int i = 0; i < this->person_size(); i++) { - ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( - 1, this->person(i), output); - } - - if (!unknown_fields().empty()) { - ::google::protobuf::internal::WireFormat::SerializeUnknownFields( - unknown_fields(), output); - } -} - -::google::protobuf::uint8* AddressBook::SerializeWithCachedSizesToArray( - ::google::protobuf::uint8* target) const { - // repeated .tutorial.Person person = 1; - for (int i = 0; i < this->person_size(); i++) { - target = ::google::protobuf::internal::WireFormatLite:: - WriteMessageNoVirtualToArray( - 1, this->person(i), target); - } - - if (!unknown_fields().empty()) { - target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( - unknown_fields(), target); - } - return target; -} - -int AddressBook::ByteSize() const { - int total_size = 0; - - // repeated .tutorial.Person person = 1; - total_size += 1 * this->person_size(); - for (int i = 0; i < this->person_size(); i++) { - total_size += - ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( - this->person(i)); - } - - if (!unknown_fields().empty()) { - total_size += - ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( - unknown_fields()); - } - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = total_size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); - return total_size; -} - -void AddressBook::MergeFrom(const ::google::protobuf::Message& from) { - GOOGLE_CHECK_NE(&from, this); - const AddressBook* source = - ::google::protobuf::internal::dynamic_cast_if_available( - &from); - if (source == NULL) { - ::google::protobuf::internal::ReflectionOps::Merge(from, this); - } else { - MergeFrom(*source); - } -} - -void AddressBook::MergeFrom(const AddressBook& from) { - GOOGLE_CHECK_NE(&from, this); - person_.MergeFrom(from.person_); - mutable_unknown_fields()->MergeFrom(from.unknown_fields()); -} - -void AddressBook::CopyFrom(const ::google::protobuf::Message& from) { - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void AddressBook::CopyFrom(const AddressBook& from) { - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool AddressBook::IsInitialized() const { - - for (int i = 0; i < person_size(); i++) { - if (!this->person(i).IsInitialized()) return false; - } - return true; -} - -void AddressBook::Swap(AddressBook* other) { - if (other != this) { - person_.Swap(&other->person_); - std::swap(_has_bits_[0], other->_has_bits_[0]); - _unknown_fields_.Swap(&other->_unknown_fields_); - std::swap(_cached_size_, other->_cached_size_); - } -} - -::google::protobuf::Metadata AddressBook::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - ::google::protobuf::Metadata metadata; - metadata.descriptor = AddressBook_descriptor_; - metadata.reflection = AddressBook_reflection_; - return metadata; -} - - -// @@protoc_insertion_point(namespace_scope) - -} // namespace tutorial - -// @@protoc_insertion_point(global_scope) diff --git a/protobuf/gen/cc/tutorial/addressbook.pb.h b/protobuf/gen/cc/tutorial/addressbook.pb.h deleted file mode 100644 index 2f5f34f..0000000 --- a/protobuf/gen/cc/tutorial/addressbook.pb.h +++ /dev/null @@ -1,752 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: addressbook.proto - -#ifndef PROTOBUF_addressbook_2eproto__INCLUDED -#define PROTOBUF_addressbook_2eproto__INCLUDED - -#include - -#include - -#if GOOGLE_PROTOBUF_VERSION < 2004000 -#error This file was generated by a newer version of protoc which is -#error incompatible with your Protocol Buffer headers. Please update -#error your headers. -#endif -#if 2004001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION -#error This file was generated by an older version of protoc which is -#error incompatible with your Protocol Buffer headers. Please -#error regenerate this file with a newer version of protoc. -#endif - -#include -#include -#include -#include -// @@protoc_insertion_point(includes) - -namespace tutorial { - -// Internal implementation detail -- do not call these. -void protobuf_AddDesc_addressbook_2eproto(); -void protobuf_AssignDesc_addressbook_2eproto(); -void protobuf_ShutdownFile_addressbook_2eproto(); - -class Person; -class Person_PhoneNumber; -class AddressBook; - -enum Person_PhoneType { - Person_PhoneType_MOBILE = 0, - Person_PhoneType_HOME = 1, - Person_PhoneType_WORK = 2 -}; -bool Person_PhoneType_IsValid(int value); -const Person_PhoneType Person_PhoneType_PhoneType_MIN = Person_PhoneType_MOBILE; -const Person_PhoneType Person_PhoneType_PhoneType_MAX = Person_PhoneType_WORK; -const int Person_PhoneType_PhoneType_ARRAYSIZE = Person_PhoneType_PhoneType_MAX + 1; - -const ::google::protobuf::EnumDescriptor* Person_PhoneType_descriptor(); -inline const ::std::string& Person_PhoneType_Name(Person_PhoneType value) { - return ::google::protobuf::internal::NameOfEnum( - Person_PhoneType_descriptor(), value); -} -inline bool Person_PhoneType_Parse( - const ::std::string& name, Person_PhoneType* value) { - return ::google::protobuf::internal::ParseNamedEnum( - Person_PhoneType_descriptor(), name, value); -} -enum Gender { - NONE = 0, - MALE = 1, - FEMALE = 2, - OTHER = 3 -}; -bool Gender_IsValid(int value); -const Gender Gender_MIN = NONE; -const Gender Gender_MAX = OTHER; -const int Gender_ARRAYSIZE = Gender_MAX + 1; - -const ::google::protobuf::EnumDescriptor* Gender_descriptor(); -inline const ::std::string& Gender_Name(Gender value) { - return ::google::protobuf::internal::NameOfEnum( - Gender_descriptor(), value); -} -inline bool Gender_Parse( - const ::std::string& name, Gender* value) { - return ::google::protobuf::internal::ParseNamedEnum( - Gender_descriptor(), name, value); -} -// =================================================================== - -class Person_PhoneNumber : public ::google::protobuf::Message { - public: - Person_PhoneNumber(); - virtual ~Person_PhoneNumber(); - - Person_PhoneNumber(const Person_PhoneNumber& from); - - inline Person_PhoneNumber& operator=(const Person_PhoneNumber& from) { - CopyFrom(from); - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { - return _unknown_fields_; - } - - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { - return &_unknown_fields_; - } - - static const ::google::protobuf::Descriptor* descriptor(); - static const Person_PhoneNumber& default_instance(); - - void Swap(Person_PhoneNumber* other); - - // implements Message ---------------------------------------------- - - Person_PhoneNumber* New() const; - void CopyFrom(const ::google::protobuf::Message& from); - void MergeFrom(const ::google::protobuf::Message& from); - void CopyFrom(const Person_PhoneNumber& from); - void MergeFrom(const Person_PhoneNumber& from); - void Clear(); - bool IsInitialized() const; - - int ByteSize() const; - bool MergePartialFromCodedStream( - ::google::protobuf::io::CodedInputStream* input); - void SerializeWithCachedSizes( - ::google::protobuf::io::CodedOutputStream* output) const; - ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; - int GetCachedSize() const { return _cached_size_; } - private: - void SharedCtor(); - void SharedDtor(); - void SetCachedSize(int size) const; - public: - - ::google::protobuf::Metadata GetMetadata() const; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - // required string number = 1; - inline bool has_number() const; - inline void clear_number(); - static const int kNumberFieldNumber = 1; - inline const ::std::string& number() const; - inline void set_number(const ::std::string& value); - inline void set_number(const char* value); - inline void set_number(const char* value, size_t size); - inline ::std::string* mutable_number(); - inline ::std::string* release_number(); - - // optional .tutorial.Person.PhoneType type = 2 [default = HOME]; - inline bool has_type() const; - inline void clear_type(); - static const int kTypeFieldNumber = 2; - inline ::tutorial::Person_PhoneType type() const; - inline void set_type(::tutorial::Person_PhoneType value); - - // @@protoc_insertion_point(class_scope:tutorial.Person.PhoneNumber) - private: - inline void set_has_number(); - inline void clear_has_number(); - inline void set_has_type(); - inline void clear_has_type(); - - ::google::protobuf::UnknownFieldSet _unknown_fields_; - - ::std::string* number_; - int type_; - - mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(2 + 31) / 32]; - - friend void protobuf_AddDesc_addressbook_2eproto(); - friend void protobuf_AssignDesc_addressbook_2eproto(); - friend void protobuf_ShutdownFile_addressbook_2eproto(); - - void InitAsDefaultInstance(); - static Person_PhoneNumber* default_instance_; -}; -// ------------------------------------------------------------------- - -class Person : public ::google::protobuf::Message { - public: - Person(); - virtual ~Person(); - - Person(const Person& from); - - inline Person& operator=(const Person& from) { - CopyFrom(from); - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { - return _unknown_fields_; - } - - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { - return &_unknown_fields_; - } - - static const ::google::protobuf::Descriptor* descriptor(); - static const Person& default_instance(); - - void Swap(Person* other); - - // implements Message ---------------------------------------------- - - Person* New() const; - void CopyFrom(const ::google::protobuf::Message& from); - void MergeFrom(const ::google::protobuf::Message& from); - void CopyFrom(const Person& from); - void MergeFrom(const Person& from); - void Clear(); - bool IsInitialized() const; - - int ByteSize() const; - bool MergePartialFromCodedStream( - ::google::protobuf::io::CodedInputStream* input); - void SerializeWithCachedSizes( - ::google::protobuf::io::CodedOutputStream* output) const; - ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; - int GetCachedSize() const { return _cached_size_; } - private: - void SharedCtor(); - void SharedDtor(); - void SetCachedSize(int size) const; - public: - - ::google::protobuf::Metadata GetMetadata() const; - - // nested types ---------------------------------------------------- - - typedef Person_PhoneNumber PhoneNumber; - - typedef Person_PhoneType PhoneType; - static const PhoneType MOBILE = Person_PhoneType_MOBILE; - static const PhoneType HOME = Person_PhoneType_HOME; - static const PhoneType WORK = Person_PhoneType_WORK; - static inline bool PhoneType_IsValid(int value) { - return Person_PhoneType_IsValid(value); - } - static const PhoneType PhoneType_MIN = - Person_PhoneType_PhoneType_MIN; - static const PhoneType PhoneType_MAX = - Person_PhoneType_PhoneType_MAX; - static const int PhoneType_ARRAYSIZE = - Person_PhoneType_PhoneType_ARRAYSIZE; - static inline const ::google::protobuf::EnumDescriptor* - PhoneType_descriptor() { - return Person_PhoneType_descriptor(); - } - static inline const ::std::string& PhoneType_Name(PhoneType value) { - return Person_PhoneType_Name(value); - } - static inline bool PhoneType_Parse(const ::std::string& name, - PhoneType* value) { - return Person_PhoneType_Parse(name, value); - } - - // accessors ------------------------------------------------------- - - // required string name = 1; - inline bool has_name() const; - inline void clear_name(); - static const int kNameFieldNumber = 1; - inline const ::std::string& name() const; - inline void set_name(const ::std::string& value); - inline void set_name(const char* value); - inline void set_name(const char* value, size_t size); - inline ::std::string* mutable_name(); - inline ::std::string* release_name(); - - // required int32 id = 2; - inline bool has_id() const; - inline void clear_id(); - static const int kIdFieldNumber = 2; - inline ::google::protobuf::int32 id() const; - inline void set_id(::google::protobuf::int32 value); - - // optional string email = 3; - inline bool has_email() const; - inline void clear_email(); - static const int kEmailFieldNumber = 3; - inline const ::std::string& email() const; - inline void set_email(const ::std::string& value); - inline void set_email(const char* value); - inline void set_email(const char* value, size_t size); - inline ::std::string* mutable_email(); - inline ::std::string* release_email(); - - // optional .tutorial.Gender type = 4 [default = NONE]; - inline bool has_type() const; - inline void clear_type(); - static const int kTypeFieldNumber = 4; - inline tutorial::Gender type() const; - inline void set_type(tutorial::Gender value); - - // repeated .tutorial.Person.PhoneNumber phone = 5; - inline int phone_size() const; - inline void clear_phone(); - static const int kPhoneFieldNumber = 5; - inline const ::tutorial::Person_PhoneNumber& phone(int index) const; - inline ::tutorial::Person_PhoneNumber* mutable_phone(int index); - inline ::tutorial::Person_PhoneNumber* add_phone(); - inline const ::google::protobuf::RepeatedPtrField< ::tutorial::Person_PhoneNumber >& - phone() const; - inline ::google::protobuf::RepeatedPtrField< ::tutorial::Person_PhoneNumber >* - mutable_phone(); - - // @@protoc_insertion_point(class_scope:tutorial.Person) - private: - inline void set_has_name(); - inline void clear_has_name(); - inline void set_has_id(); - inline void clear_has_id(); - inline void set_has_email(); - inline void clear_has_email(); - inline void set_has_type(); - inline void clear_has_type(); - - ::google::protobuf::UnknownFieldSet _unknown_fields_; - - ::std::string* name_; - ::std::string* email_; - ::google::protobuf::int32 id_; - int type_; - ::google::protobuf::RepeatedPtrField< ::tutorial::Person_PhoneNumber > phone_; - - mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(5 + 31) / 32]; - - friend void protobuf_AddDesc_addressbook_2eproto(); - friend void protobuf_AssignDesc_addressbook_2eproto(); - friend void protobuf_ShutdownFile_addressbook_2eproto(); - - void InitAsDefaultInstance(); - static Person* default_instance_; -}; -// ------------------------------------------------------------------- - -class AddressBook : public ::google::protobuf::Message { - public: - AddressBook(); - virtual ~AddressBook(); - - AddressBook(const AddressBook& from); - - inline AddressBook& operator=(const AddressBook& from) { - CopyFrom(from); - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { - return _unknown_fields_; - } - - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { - return &_unknown_fields_; - } - - static const ::google::protobuf::Descriptor* descriptor(); - static const AddressBook& default_instance(); - - void Swap(AddressBook* other); - - // implements Message ---------------------------------------------- - - AddressBook* New() const; - void CopyFrom(const ::google::protobuf::Message& from); - void MergeFrom(const ::google::protobuf::Message& from); - void CopyFrom(const AddressBook& from); - void MergeFrom(const AddressBook& from); - void Clear(); - bool IsInitialized() const; - - int ByteSize() const; - bool MergePartialFromCodedStream( - ::google::protobuf::io::CodedInputStream* input); - void SerializeWithCachedSizes( - ::google::protobuf::io::CodedOutputStream* output) const; - ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; - int GetCachedSize() const { return _cached_size_; } - private: - void SharedCtor(); - void SharedDtor(); - void SetCachedSize(int size) const; - public: - - ::google::protobuf::Metadata GetMetadata() const; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - // repeated .tutorial.Person person = 1; - inline int person_size() const; - inline void clear_person(); - static const int kPersonFieldNumber = 1; - inline const ::tutorial::Person& person(int index) const; - inline ::tutorial::Person* mutable_person(int index); - inline ::tutorial::Person* add_person(); - inline const ::google::protobuf::RepeatedPtrField< ::tutorial::Person >& - person() const; - inline ::google::protobuf::RepeatedPtrField< ::tutorial::Person >* - mutable_person(); - - // @@protoc_insertion_point(class_scope:tutorial.AddressBook) - private: - - ::google::protobuf::UnknownFieldSet _unknown_fields_; - - ::google::protobuf::RepeatedPtrField< ::tutorial::Person > person_; - - mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(1 + 31) / 32]; - - friend void protobuf_AddDesc_addressbook_2eproto(); - friend void protobuf_AssignDesc_addressbook_2eproto(); - friend void protobuf_ShutdownFile_addressbook_2eproto(); - - void InitAsDefaultInstance(); - static AddressBook* default_instance_; -}; -// =================================================================== - - -// =================================================================== - -// Person_PhoneNumber - -// required string number = 1; -inline bool Person_PhoneNumber::has_number() const { - return (_has_bits_[0] & 0x00000001u) != 0; -} -inline void Person_PhoneNumber::set_has_number() { - _has_bits_[0] |= 0x00000001u; -} -inline void Person_PhoneNumber::clear_has_number() { - _has_bits_[0] &= ~0x00000001u; -} -inline void Person_PhoneNumber::clear_number() { - if (number_ != &::google::protobuf::internal::kEmptyString) { - number_->clear(); - } - clear_has_number(); -} -inline const ::std::string& Person_PhoneNumber::number() const { - return *number_; -} -inline void Person_PhoneNumber::set_number(const ::std::string& value) { - set_has_number(); - if (number_ == &::google::protobuf::internal::kEmptyString) { - number_ = new ::std::string; - } - number_->assign(value); -} -inline void Person_PhoneNumber::set_number(const char* value) { - set_has_number(); - if (number_ == &::google::protobuf::internal::kEmptyString) { - number_ = new ::std::string; - } - number_->assign(value); -} -inline void Person_PhoneNumber::set_number(const char* value, size_t size) { - set_has_number(); - if (number_ == &::google::protobuf::internal::kEmptyString) { - number_ = new ::std::string; - } - number_->assign(reinterpret_cast(value), size); -} -inline ::std::string* Person_PhoneNumber::mutable_number() { - set_has_number(); - if (number_ == &::google::protobuf::internal::kEmptyString) { - number_ = new ::std::string; - } - return number_; -} -inline ::std::string* Person_PhoneNumber::release_number() { - clear_has_number(); - if (number_ == &::google::protobuf::internal::kEmptyString) { - return NULL; - } else { - ::std::string* temp = number_; - number_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); - return temp; - } -} - -// optional .tutorial.Person.PhoneType type = 2 [default = HOME]; -inline bool Person_PhoneNumber::has_type() const { - return (_has_bits_[0] & 0x00000002u) != 0; -} -inline void Person_PhoneNumber::set_has_type() { - _has_bits_[0] |= 0x00000002u; -} -inline void Person_PhoneNumber::clear_has_type() { - _has_bits_[0] &= ~0x00000002u; -} -inline void Person_PhoneNumber::clear_type() { - type_ = 1; - clear_has_type(); -} -inline ::tutorial::Person_PhoneType Person_PhoneNumber::type() const { - return static_cast< ::tutorial::Person_PhoneType >(type_); -} -inline void Person_PhoneNumber::set_type(::tutorial::Person_PhoneType value) { - GOOGLE_DCHECK(::tutorial::Person_PhoneType_IsValid(value)); - set_has_type(); - type_ = value; -} - -// ------------------------------------------------------------------- - -// Person - -// required string name = 1; -inline bool Person::has_name() const { - return (_has_bits_[0] & 0x00000001u) != 0; -} -inline void Person::set_has_name() { - _has_bits_[0] |= 0x00000001u; -} -inline void Person::clear_has_name() { - _has_bits_[0] &= ~0x00000001u; -} -inline void Person::clear_name() { - if (name_ != &::google::protobuf::internal::kEmptyString) { - name_->clear(); - } - clear_has_name(); -} -inline const ::std::string& Person::name() const { - return *name_; -} -inline void Person::set_name(const ::std::string& value) { - set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { - name_ = new ::std::string; - } - name_->assign(value); -} -inline void Person::set_name(const char* value) { - set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { - name_ = new ::std::string; - } - name_->assign(value); -} -inline void Person::set_name(const char* value, size_t size) { - set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { - name_ = new ::std::string; - } - name_->assign(reinterpret_cast(value), size); -} -inline ::std::string* Person::mutable_name() { - set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { - name_ = new ::std::string; - } - return name_; -} -inline ::std::string* Person::release_name() { - clear_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { - return NULL; - } else { - ::std::string* temp = name_; - name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); - return temp; - } -} - -// required int32 id = 2; -inline bool Person::has_id() const { - return (_has_bits_[0] & 0x00000002u) != 0; -} -inline void Person::set_has_id() { - _has_bits_[0] |= 0x00000002u; -} -inline void Person::clear_has_id() { - _has_bits_[0] &= ~0x00000002u; -} -inline void Person::clear_id() { - id_ = 0; - clear_has_id(); -} -inline ::google::protobuf::int32 Person::id() const { - return id_; -} -inline void Person::set_id(::google::protobuf::int32 value) { - set_has_id(); - id_ = value; -} - -// optional string email = 3; -inline bool Person::has_email() const { - return (_has_bits_[0] & 0x00000004u) != 0; -} -inline void Person::set_has_email() { - _has_bits_[0] |= 0x00000004u; -} -inline void Person::clear_has_email() { - _has_bits_[0] &= ~0x00000004u; -} -inline void Person::clear_email() { - if (email_ != &::google::protobuf::internal::kEmptyString) { - email_->clear(); - } - clear_has_email(); -} -inline const ::std::string& Person::email() const { - return *email_; -} -inline void Person::set_email(const ::std::string& value) { - set_has_email(); - if (email_ == &::google::protobuf::internal::kEmptyString) { - email_ = new ::std::string; - } - email_->assign(value); -} -inline void Person::set_email(const char* value) { - set_has_email(); - if (email_ == &::google::protobuf::internal::kEmptyString) { - email_ = new ::std::string; - } - email_->assign(value); -} -inline void Person::set_email(const char* value, size_t size) { - set_has_email(); - if (email_ == &::google::protobuf::internal::kEmptyString) { - email_ = new ::std::string; - } - email_->assign(reinterpret_cast(value), size); -} -inline ::std::string* Person::mutable_email() { - set_has_email(); - if (email_ == &::google::protobuf::internal::kEmptyString) { - email_ = new ::std::string; - } - return email_; -} -inline ::std::string* Person::release_email() { - clear_has_email(); - if (email_ == &::google::protobuf::internal::kEmptyString) { - return NULL; - } else { - ::std::string* temp = email_; - email_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); - return temp; - } -} - -// optional .tutorial.Gender type = 4 [default = NONE]; -inline bool Person::has_type() const { - return (_has_bits_[0] & 0x00000008u) != 0; -} -inline void Person::set_has_type() { - _has_bits_[0] |= 0x00000008u; -} -inline void Person::clear_has_type() { - _has_bits_[0] &= ~0x00000008u; -} -inline void Person::clear_type() { - type_ = 0; - clear_has_type(); -} -inline tutorial::Gender Person::type() const { - return static_cast< tutorial::Gender >(type_); -} -inline void Person::set_type(tutorial::Gender value) { - GOOGLE_DCHECK(tutorial::Gender_IsValid(value)); - set_has_type(); - type_ = value; -} - -// repeated .tutorial.Person.PhoneNumber phone = 5; -inline int Person::phone_size() const { - return phone_.size(); -} -inline void Person::clear_phone() { - phone_.Clear(); -} -inline const ::tutorial::Person_PhoneNumber& Person::phone(int index) const { - return phone_.Get(index); -} -inline ::tutorial::Person_PhoneNumber* Person::mutable_phone(int index) { - return phone_.Mutable(index); -} -inline ::tutorial::Person_PhoneNumber* Person::add_phone() { - return phone_.Add(); -} -inline const ::google::protobuf::RepeatedPtrField< ::tutorial::Person_PhoneNumber >& -Person::phone() const { - return phone_; -} -inline ::google::protobuf::RepeatedPtrField< ::tutorial::Person_PhoneNumber >* -Person::mutable_phone() { - return &phone_; -} - -// ------------------------------------------------------------------- - -// AddressBook - -// repeated .tutorial.Person person = 1; -inline int AddressBook::person_size() const { - return person_.size(); -} -inline void AddressBook::clear_person() { - person_.Clear(); -} -inline const ::tutorial::Person& AddressBook::person(int index) const { - return person_.Get(index); -} -inline ::tutorial::Person* AddressBook::mutable_person(int index) { - return person_.Mutable(index); -} -inline ::tutorial::Person* AddressBook::add_person() { - return person_.Add(); -} -inline const ::google::protobuf::RepeatedPtrField< ::tutorial::Person >& -AddressBook::person() const { - return person_; -} -inline ::google::protobuf::RepeatedPtrField< ::tutorial::Person >* -AddressBook::mutable_person() { - return &person_; -} - - -// @@protoc_insertion_point(namespace_scope) - -} // namespace tutorial - -#ifndef SWIG -namespace google { -namespace protobuf { - -template <> -inline const EnumDescriptor* GetEnumDescriptor< ::tutorial::Person_PhoneType>() { - return ::tutorial::Person_PhoneType_descriptor(); -} -template <> -inline const EnumDescriptor* GetEnumDescriptor< tutorial::Gender>() { - return tutorial::Gender_descriptor(); -} - -} // namespace google -} // namespace protobuf -#endif // SWIG - -// @@protoc_insertion_point(global_scope) - -#endif // PROTOBUF_addressbook_2eproto__INCLUDED diff --git a/protobuf/gen/java/tutorial/addressbook.java b/protobuf/gen/java/tutorial/addressbook.java deleted file mode 100644 index 999c143..0000000 --- a/protobuf/gen/java/tutorial/addressbook.java +++ /dev/null @@ -1,2137 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: addressbook.proto - -package tutorial; - -public final class Addressbook { - private Addressbook() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - } - public enum Gender - implements com.google.protobuf.ProtocolMessageEnum { - NONE(0, 0), - MALE(1, 1), - FEMALE(2, 2), - OTHER(3, 3), - ; - - public static final int NONE_VALUE = 0; - public static final int MALE_VALUE = 1; - public static final int FEMALE_VALUE = 2; - public static final int OTHER_VALUE = 3; - - - public final int getNumber() { return value; } - - public static Gender valueOf(int value) { - switch (value) { - case 0: return NONE; - case 1: return MALE; - case 2: return FEMALE; - case 3: return OTHER; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static com.google.protobuf.Internal.EnumLiteMap - internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public Gender findValueByNumber(int number) { - return Gender.valueOf(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - return getDescriptor().getValues().get(index); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return tutorial.Addressbook.getDescriptor().getEnumTypes().get(0); - } - - private static final Gender[] VALUES = { - NONE, MALE, FEMALE, OTHER, - }; - - public static Gender valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - return VALUES[desc.getIndex()]; - } - - private final int index; - private final int value; - - private Gender(int index, int value) { - this.index = index; - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:tutorial.Gender) - } - - public interface PersonOrBuilder - extends com.google.protobuf.MessageOrBuilder { - - // required string name = 1; - boolean hasName(); - String getName(); - - // required int32 id = 2; - boolean hasId(); - int getId(); - - // optional string email = 3; - boolean hasEmail(); - String getEmail(); - - // optional .tutorial.Gender type = 4 [default = NONE]; - boolean hasType(); - tutorial.Addressbook.Gender getType(); - - // repeated .tutorial.Person.PhoneNumber phone = 5; - java.util.List - getPhoneList(); - tutorial.Addressbook.Person.PhoneNumber getPhone(int index); - int getPhoneCount(); - java.util.List - getPhoneOrBuilderList(); - tutorial.Addressbook.Person.PhoneNumberOrBuilder getPhoneOrBuilder( - int index); - } - public static final class Person extends - com.google.protobuf.GeneratedMessage - implements PersonOrBuilder { - // Use Person.newBuilder() to construct. - private Person(Builder builder) { - super(builder); - } - private Person(boolean noInit) {} - - private static final Person defaultInstance; - public static Person getDefaultInstance() { - return defaultInstance; - } - - public Person getDefaultInstanceForType() { - return defaultInstance; - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return tutorial.Addressbook.internal_static_tutorial_Person_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return tutorial.Addressbook.internal_static_tutorial_Person_fieldAccessorTable; - } - - public enum PhoneType - implements com.google.protobuf.ProtocolMessageEnum { - MOBILE(0, 0), - HOME(1, 1), - WORK(2, 2), - ; - - public static final int MOBILE_VALUE = 0; - public static final int HOME_VALUE = 1; - public static final int WORK_VALUE = 2; - - - public final int getNumber() { return value; } - - public static PhoneType valueOf(int value) { - switch (value) { - case 0: return MOBILE; - case 1: return HOME; - case 2: return WORK; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static com.google.protobuf.Internal.EnumLiteMap - internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public PhoneType findValueByNumber(int number) { - return PhoneType.valueOf(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - return getDescriptor().getValues().get(index); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return tutorial.Addressbook.Person.getDescriptor().getEnumTypes().get(0); - } - - private static final PhoneType[] VALUES = { - MOBILE, HOME, WORK, - }; - - public static PhoneType valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - return VALUES[desc.getIndex()]; - } - - private final int index; - private final int value; - - private PhoneType(int index, int value) { - this.index = index; - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:tutorial.Person.PhoneType) - } - - public interface PhoneNumberOrBuilder - extends com.google.protobuf.MessageOrBuilder { - - // required string number = 1; - boolean hasNumber(); - String getNumber(); - - // optional .tutorial.Person.PhoneType type = 2 [default = HOME]; - boolean hasType(); - tutorial.Addressbook.Person.PhoneType getType(); - } - public static final class PhoneNumber extends - com.google.protobuf.GeneratedMessage - implements PhoneNumberOrBuilder { - // Use PhoneNumber.newBuilder() to construct. - private PhoneNumber(Builder builder) { - super(builder); - } - private PhoneNumber(boolean noInit) {} - - private static final PhoneNumber defaultInstance; - public static PhoneNumber getDefaultInstance() { - return defaultInstance; - } - - public PhoneNumber getDefaultInstanceForType() { - return defaultInstance; - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return tutorial.Addressbook.internal_static_tutorial_Person_PhoneNumber_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return tutorial.Addressbook.internal_static_tutorial_Person_PhoneNumber_fieldAccessorTable; - } - - private int bitField0_; - // required string number = 1; - public static final int NUMBER_FIELD_NUMBER = 1; - private java.lang.Object number_; - public boolean hasNumber() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - public String getNumber() { - java.lang.Object ref = number_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - if (com.google.protobuf.Internal.isValidUtf8(bs)) { - number_ = s; - } - return s; - } - } - private com.google.protobuf.ByteString getNumberBytes() { - java.lang.Object ref = number_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((String) ref); - number_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - // optional .tutorial.Person.PhoneType type = 2 [default = HOME]; - public static final int TYPE_FIELD_NUMBER = 2; - private tutorial.Addressbook.Person.PhoneType type_; - public boolean hasType() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - public tutorial.Addressbook.Person.PhoneType getType() { - return type_; - } - - private void initFields() { - number_ = ""; - type_ = tutorial.Addressbook.Person.PhoneType.HOME; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized != -1) return isInitialized == 1; - - if (!hasNumber()) { - memoizedIsInitialized = 0; - return false; - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeBytes(1, getNumberBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeEnum(2, type_.getNumber()); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(1, getNumberBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(2, type_.getNumber()); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static tutorial.Addressbook.Person.PhoneNumber parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); - } - public static tutorial.Addressbook.Person.PhoneNumber parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); - } - public static tutorial.Addressbook.Person.PhoneNumber parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); - } - public static tutorial.Addressbook.Person.PhoneNumber parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); - } - public static tutorial.Addressbook.Person.PhoneNumber parseFrom(java.io.InputStream input) - throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); - } - public static tutorial.Addressbook.Person.PhoneNumber parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); - } - public static tutorial.Addressbook.Person.PhoneNumber parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } - } - public static tutorial.Addressbook.Person.PhoneNumber parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } - } - public static tutorial.Addressbook.Person.PhoneNumber parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); - } - public static tutorial.Addressbook.Person.PhoneNumber parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(tutorial.Addressbook.Person.PhoneNumber prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder - implements tutorial.Addressbook.Person.PhoneNumberOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return tutorial.Addressbook.internal_static_tutorial_Person_PhoneNumber_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return tutorial.Addressbook.internal_static_tutorial_Person_PhoneNumber_fieldAccessorTable; - } - - // Construct using tutorial.Addressbook.Person.PhoneNumber.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - number_ = ""; - bitField0_ = (bitField0_ & ~0x00000001); - type_ = tutorial.Addressbook.Person.PhoneType.HOME; - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return tutorial.Addressbook.Person.PhoneNumber.getDescriptor(); - } - - public tutorial.Addressbook.Person.PhoneNumber getDefaultInstanceForType() { - return tutorial.Addressbook.Person.PhoneNumber.getDefaultInstance(); - } - - public tutorial.Addressbook.Person.PhoneNumber build() { - tutorial.Addressbook.Person.PhoneNumber result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - private tutorial.Addressbook.Person.PhoneNumber buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - tutorial.Addressbook.Person.PhoneNumber result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return result; - } - - public tutorial.Addressbook.Person.PhoneNumber buildPartial() { - tutorial.Addressbook.Person.PhoneNumber result = new tutorial.Addressbook.Person.PhoneNumber(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.number_ = number_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.type_ = type_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof tutorial.Addressbook.Person.PhoneNumber) { - return mergeFrom((tutorial.Addressbook.Person.PhoneNumber)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(tutorial.Addressbook.Person.PhoneNumber other) { - if (other == tutorial.Addressbook.Person.PhoneNumber.getDefaultInstance()) return this; - if (other.hasNumber()) { - setNumber(other.getNumber()); - } - if (other.hasType()) { - setType(other.getType()); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - if (!hasNumber()) { - - return false; - } - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder( - this.getUnknownFields()); - while (true) { - int tag = input.readTag(); - switch (tag) { - case 0: - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - } - break; - } - case 10: { - bitField0_ |= 0x00000001; - number_ = input.readBytes(); - break; - } - case 16: { - int rawValue = input.readEnum(); - tutorial.Addressbook.Person.PhoneType value = tutorial.Addressbook.Person.PhoneType.valueOf(rawValue); - if (value == null) { - unknownFields.mergeVarintField(2, rawValue); - } else { - bitField0_ |= 0x00000002; - type_ = value; - } - break; - } - } - } - } - - private int bitField0_; - - // required string number = 1; - private java.lang.Object number_ = ""; - public boolean hasNumber() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - public String getNumber() { - java.lang.Object ref = number_; - if (!(ref instanceof String)) { - String s = ((com.google.protobuf.ByteString) ref).toStringUtf8(); - number_ = s; - return s; - } else { - return (String) ref; - } - } - public Builder setNumber(String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - number_ = value; - onChanged(); - return this; - } - public Builder clearNumber() { - bitField0_ = (bitField0_ & ~0x00000001); - number_ = getDefaultInstance().getNumber(); - onChanged(); - return this; - } - void setNumber(com.google.protobuf.ByteString value) { - bitField0_ |= 0x00000001; - number_ = value; - onChanged(); - } - - // optional .tutorial.Person.PhoneType type = 2 [default = HOME]; - private tutorial.Addressbook.Person.PhoneType type_ = tutorial.Addressbook.Person.PhoneType.HOME; - public boolean hasType() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - public tutorial.Addressbook.Person.PhoneType getType() { - return type_; - } - public Builder setType(tutorial.Addressbook.Person.PhoneType value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - type_ = value; - onChanged(); - return this; - } - public Builder clearType() { - bitField0_ = (bitField0_ & ~0x00000002); - type_ = tutorial.Addressbook.Person.PhoneType.HOME; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:tutorial.Person.PhoneNumber) - } - - static { - defaultInstance = new PhoneNumber(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:tutorial.Person.PhoneNumber) - } - - private int bitField0_; - // required string name = 1; - public static final int NAME_FIELD_NUMBER = 1; - private java.lang.Object name_; - public boolean hasName() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - public String getName() { - java.lang.Object ref = name_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - if (com.google.protobuf.Internal.isValidUtf8(bs)) { - name_ = s; - } - return s; - } - } - private com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - // required int32 id = 2; - public static final int ID_FIELD_NUMBER = 2; - private int id_; - public boolean hasId() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - public int getId() { - return id_; - } - - // optional string email = 3; - public static final int EMAIL_FIELD_NUMBER = 3; - private java.lang.Object email_; - public boolean hasEmail() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - public String getEmail() { - java.lang.Object ref = email_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - if (com.google.protobuf.Internal.isValidUtf8(bs)) { - email_ = s; - } - return s; - } - } - private com.google.protobuf.ByteString getEmailBytes() { - java.lang.Object ref = email_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((String) ref); - email_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - // optional .tutorial.Gender type = 4 [default = NONE]; - public static final int TYPE_FIELD_NUMBER = 4; - private tutorial.Addressbook.Gender type_; - public boolean hasType() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - public tutorial.Addressbook.Gender getType() { - return type_; - } - - // repeated .tutorial.Person.PhoneNumber phone = 5; - public static final int PHONE_FIELD_NUMBER = 5; - private java.util.List phone_; - public java.util.List getPhoneList() { - return phone_; - } - public java.util.List - getPhoneOrBuilderList() { - return phone_; - } - public int getPhoneCount() { - return phone_.size(); - } - public tutorial.Addressbook.Person.PhoneNumber getPhone(int index) { - return phone_.get(index); - } - public tutorial.Addressbook.Person.PhoneNumberOrBuilder getPhoneOrBuilder( - int index) { - return phone_.get(index); - } - - private void initFields() { - name_ = ""; - id_ = 0; - email_ = ""; - type_ = tutorial.Addressbook.Gender.NONE; - phone_ = java.util.Collections.emptyList(); - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized != -1) return isInitialized == 1; - - if (!hasName()) { - memoizedIsInitialized = 0; - return false; - } - if (!hasId()) { - memoizedIsInitialized = 0; - return false; - } - for (int i = 0; i < getPhoneCount(); i++) { - if (!getPhone(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeBytes(1, getNameBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeInt32(2, id_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeBytes(3, getEmailBytes()); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeEnum(4, type_.getNumber()); - } - for (int i = 0; i < phone_.size(); i++) { - output.writeMessage(5, phone_.get(i)); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(1, getNameBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, id_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(3, getEmailBytes()); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(4, type_.getNumber()); - } - for (int i = 0; i < phone_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, phone_.get(i)); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static tutorial.Addressbook.Person parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); - } - public static tutorial.Addressbook.Person parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); - } - public static tutorial.Addressbook.Person parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); - } - public static tutorial.Addressbook.Person parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); - } - public static tutorial.Addressbook.Person parseFrom(java.io.InputStream input) - throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); - } - public static tutorial.Addressbook.Person parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); - } - public static tutorial.Addressbook.Person parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } - } - public static tutorial.Addressbook.Person parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } - } - public static tutorial.Addressbook.Person parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); - } - public static tutorial.Addressbook.Person parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(tutorial.Addressbook.Person prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder - implements tutorial.Addressbook.PersonOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return tutorial.Addressbook.internal_static_tutorial_Person_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return tutorial.Addressbook.internal_static_tutorial_Person_fieldAccessorTable; - } - - // Construct using tutorial.Addressbook.Person.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - getPhoneFieldBuilder(); - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - name_ = ""; - bitField0_ = (bitField0_ & ~0x00000001); - id_ = 0; - bitField0_ = (bitField0_ & ~0x00000002); - email_ = ""; - bitField0_ = (bitField0_ & ~0x00000004); - type_ = tutorial.Addressbook.Gender.NONE; - bitField0_ = (bitField0_ & ~0x00000008); - if (phoneBuilder_ == null) { - phone_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000010); - } else { - phoneBuilder_.clear(); - } - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return tutorial.Addressbook.Person.getDescriptor(); - } - - public tutorial.Addressbook.Person getDefaultInstanceForType() { - return tutorial.Addressbook.Person.getDefaultInstance(); - } - - public tutorial.Addressbook.Person build() { - tutorial.Addressbook.Person result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - private tutorial.Addressbook.Person buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - tutorial.Addressbook.Person result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return result; - } - - public tutorial.Addressbook.Person buildPartial() { - tutorial.Addressbook.Person result = new tutorial.Addressbook.Person(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.name_ = name_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.id_ = id_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.email_ = email_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000008; - } - result.type_ = type_; - if (phoneBuilder_ == null) { - if (((bitField0_ & 0x00000010) == 0x00000010)) { - phone_ = java.util.Collections.unmodifiableList(phone_); - bitField0_ = (bitField0_ & ~0x00000010); - } - result.phone_ = phone_; - } else { - result.phone_ = phoneBuilder_.build(); - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof tutorial.Addressbook.Person) { - return mergeFrom((tutorial.Addressbook.Person)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(tutorial.Addressbook.Person other) { - if (other == tutorial.Addressbook.Person.getDefaultInstance()) return this; - if (other.hasName()) { - setName(other.getName()); - } - if (other.hasId()) { - setId(other.getId()); - } - if (other.hasEmail()) { - setEmail(other.getEmail()); - } - if (other.hasType()) { - setType(other.getType()); - } - if (phoneBuilder_ == null) { - if (!other.phone_.isEmpty()) { - if (phone_.isEmpty()) { - phone_ = other.phone_; - bitField0_ = (bitField0_ & ~0x00000010); - } else { - ensurePhoneIsMutable(); - phone_.addAll(other.phone_); - } - onChanged(); - } - } else { - if (!other.phone_.isEmpty()) { - if (phoneBuilder_.isEmpty()) { - phoneBuilder_.dispose(); - phoneBuilder_ = null; - phone_ = other.phone_; - bitField0_ = (bitField0_ & ~0x00000010); - phoneBuilder_ = - com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? - getPhoneFieldBuilder() : null; - } else { - phoneBuilder_.addAllMessages(other.phone_); - } - } - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - if (!hasName()) { - - return false; - } - if (!hasId()) { - - return false; - } - for (int i = 0; i < getPhoneCount(); i++) { - if (!getPhone(i).isInitialized()) { - - return false; - } - } - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder( - this.getUnknownFields()); - while (true) { - int tag = input.readTag(); - switch (tag) { - case 0: - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - } - break; - } - case 10: { - bitField0_ |= 0x00000001; - name_ = input.readBytes(); - break; - } - case 16: { - bitField0_ |= 0x00000002; - id_ = input.readInt32(); - break; - } - case 26: { - bitField0_ |= 0x00000004; - email_ = input.readBytes(); - break; - } - case 32: { - int rawValue = input.readEnum(); - tutorial.Addressbook.Gender value = tutorial.Addressbook.Gender.valueOf(rawValue); - if (value == null) { - unknownFields.mergeVarintField(4, rawValue); - } else { - bitField0_ |= 0x00000008; - type_ = value; - } - break; - } - case 42: { - tutorial.Addressbook.Person.PhoneNumber.Builder subBuilder = tutorial.Addressbook.Person.PhoneNumber.newBuilder(); - input.readMessage(subBuilder, extensionRegistry); - addPhone(subBuilder.buildPartial()); - break; - } - } - } - } - - private int bitField0_; - - // required string name = 1; - private java.lang.Object name_ = ""; - public boolean hasName() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - public String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof String)) { - String s = ((com.google.protobuf.ByteString) ref).toStringUtf8(); - name_ = s; - return s; - } else { - return (String) ref; - } - } - public Builder setName(String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - name_ = value; - onChanged(); - return this; - } - public Builder clearName() { - bitField0_ = (bitField0_ & ~0x00000001); - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - void setName(com.google.protobuf.ByteString value) { - bitField0_ |= 0x00000001; - name_ = value; - onChanged(); - } - - // required int32 id = 2; - private int id_ ; - public boolean hasId() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - public int getId() { - return id_; - } - public Builder setId(int value) { - bitField0_ |= 0x00000002; - id_ = value; - onChanged(); - return this; - } - public Builder clearId() { - bitField0_ = (bitField0_ & ~0x00000002); - id_ = 0; - onChanged(); - return this; - } - - // optional string email = 3; - private java.lang.Object email_ = ""; - public boolean hasEmail() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - public String getEmail() { - java.lang.Object ref = email_; - if (!(ref instanceof String)) { - String s = ((com.google.protobuf.ByteString) ref).toStringUtf8(); - email_ = s; - return s; - } else { - return (String) ref; - } - } - public Builder setEmail(String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000004; - email_ = value; - onChanged(); - return this; - } - public Builder clearEmail() { - bitField0_ = (bitField0_ & ~0x00000004); - email_ = getDefaultInstance().getEmail(); - onChanged(); - return this; - } - void setEmail(com.google.protobuf.ByteString value) { - bitField0_ |= 0x00000004; - email_ = value; - onChanged(); - } - - // optional .tutorial.Gender type = 4 [default = NONE]; - private tutorial.Addressbook.Gender type_ = tutorial.Addressbook.Gender.NONE; - public boolean hasType() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - public tutorial.Addressbook.Gender getType() { - return type_; - } - public Builder setType(tutorial.Addressbook.Gender value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000008; - type_ = value; - onChanged(); - return this; - } - public Builder clearType() { - bitField0_ = (bitField0_ & ~0x00000008); - type_ = tutorial.Addressbook.Gender.NONE; - onChanged(); - return this; - } - - // repeated .tutorial.Person.PhoneNumber phone = 5; - private java.util.List phone_ = - java.util.Collections.emptyList(); - private void ensurePhoneIsMutable() { - if (!((bitField0_ & 0x00000010) == 0x00000010)) { - phone_ = new java.util.ArrayList(phone_); - bitField0_ |= 0x00000010; - } - } - - private com.google.protobuf.RepeatedFieldBuilder< - tutorial.Addressbook.Person.PhoneNumber, tutorial.Addressbook.Person.PhoneNumber.Builder, tutorial.Addressbook.Person.PhoneNumberOrBuilder> phoneBuilder_; - - public java.util.List getPhoneList() { - if (phoneBuilder_ == null) { - return java.util.Collections.unmodifiableList(phone_); - } else { - return phoneBuilder_.getMessageList(); - } - } - public int getPhoneCount() { - if (phoneBuilder_ == null) { - return phone_.size(); - } else { - return phoneBuilder_.getCount(); - } - } - public tutorial.Addressbook.Person.PhoneNumber getPhone(int index) { - if (phoneBuilder_ == null) { - return phone_.get(index); - } else { - return phoneBuilder_.getMessage(index); - } - } - public Builder setPhone( - int index, tutorial.Addressbook.Person.PhoneNumber value) { - if (phoneBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePhoneIsMutable(); - phone_.set(index, value); - onChanged(); - } else { - phoneBuilder_.setMessage(index, value); - } - return this; - } - public Builder setPhone( - int index, tutorial.Addressbook.Person.PhoneNumber.Builder builderForValue) { - if (phoneBuilder_ == null) { - ensurePhoneIsMutable(); - phone_.set(index, builderForValue.build()); - onChanged(); - } else { - phoneBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - public Builder addPhone(tutorial.Addressbook.Person.PhoneNumber value) { - if (phoneBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePhoneIsMutable(); - phone_.add(value); - onChanged(); - } else { - phoneBuilder_.addMessage(value); - } - return this; - } - public Builder addPhone( - int index, tutorial.Addressbook.Person.PhoneNumber value) { - if (phoneBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePhoneIsMutable(); - phone_.add(index, value); - onChanged(); - } else { - phoneBuilder_.addMessage(index, value); - } - return this; - } - public Builder addPhone( - tutorial.Addressbook.Person.PhoneNumber.Builder builderForValue) { - if (phoneBuilder_ == null) { - ensurePhoneIsMutable(); - phone_.add(builderForValue.build()); - onChanged(); - } else { - phoneBuilder_.addMessage(builderForValue.build()); - } - return this; - } - public Builder addPhone( - int index, tutorial.Addressbook.Person.PhoneNumber.Builder builderForValue) { - if (phoneBuilder_ == null) { - ensurePhoneIsMutable(); - phone_.add(index, builderForValue.build()); - onChanged(); - } else { - phoneBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - public Builder addAllPhone( - java.lang.Iterable values) { - if (phoneBuilder_ == null) { - ensurePhoneIsMutable(); - super.addAll(values, phone_); - onChanged(); - } else { - phoneBuilder_.addAllMessages(values); - } - return this; - } - public Builder clearPhone() { - if (phoneBuilder_ == null) { - phone_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000010); - onChanged(); - } else { - phoneBuilder_.clear(); - } - return this; - } - public Builder removePhone(int index) { - if (phoneBuilder_ == null) { - ensurePhoneIsMutable(); - phone_.remove(index); - onChanged(); - } else { - phoneBuilder_.remove(index); - } - return this; - } - public tutorial.Addressbook.Person.PhoneNumber.Builder getPhoneBuilder( - int index) { - return getPhoneFieldBuilder().getBuilder(index); - } - public tutorial.Addressbook.Person.PhoneNumberOrBuilder getPhoneOrBuilder( - int index) { - if (phoneBuilder_ == null) { - return phone_.get(index); } else { - return phoneBuilder_.getMessageOrBuilder(index); - } - } - public java.util.List - getPhoneOrBuilderList() { - if (phoneBuilder_ != null) { - return phoneBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(phone_); - } - } - public tutorial.Addressbook.Person.PhoneNumber.Builder addPhoneBuilder() { - return getPhoneFieldBuilder().addBuilder( - tutorial.Addressbook.Person.PhoneNumber.getDefaultInstance()); - } - public tutorial.Addressbook.Person.PhoneNumber.Builder addPhoneBuilder( - int index) { - return getPhoneFieldBuilder().addBuilder( - index, tutorial.Addressbook.Person.PhoneNumber.getDefaultInstance()); - } - public java.util.List - getPhoneBuilderList() { - return getPhoneFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilder< - tutorial.Addressbook.Person.PhoneNumber, tutorial.Addressbook.Person.PhoneNumber.Builder, tutorial.Addressbook.Person.PhoneNumberOrBuilder> - getPhoneFieldBuilder() { - if (phoneBuilder_ == null) { - phoneBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - tutorial.Addressbook.Person.PhoneNumber, tutorial.Addressbook.Person.PhoneNumber.Builder, tutorial.Addressbook.Person.PhoneNumberOrBuilder>( - phone_, - ((bitField0_ & 0x00000010) == 0x00000010), - getParentForChildren(), - isClean()); - phone_ = null; - } - return phoneBuilder_; - } - - // @@protoc_insertion_point(builder_scope:tutorial.Person) - } - - static { - defaultInstance = new Person(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:tutorial.Person) - } - - public interface AddressBookOrBuilder - extends com.google.protobuf.MessageOrBuilder { - - // repeated .tutorial.Person person = 1; - java.util.List - getPersonList(); - tutorial.Addressbook.Person getPerson(int index); - int getPersonCount(); - java.util.List - getPersonOrBuilderList(); - tutorial.Addressbook.PersonOrBuilder getPersonOrBuilder( - int index); - } - public static final class AddressBook extends - com.google.protobuf.GeneratedMessage - implements AddressBookOrBuilder { - // Use AddressBook.newBuilder() to construct. - private AddressBook(Builder builder) { - super(builder); - } - private AddressBook(boolean noInit) {} - - private static final AddressBook defaultInstance; - public static AddressBook getDefaultInstance() { - return defaultInstance; - } - - public AddressBook getDefaultInstanceForType() { - return defaultInstance; - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return tutorial.Addressbook.internal_static_tutorial_AddressBook_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return tutorial.Addressbook.internal_static_tutorial_AddressBook_fieldAccessorTable; - } - - // repeated .tutorial.Person person = 1; - public static final int PERSON_FIELD_NUMBER = 1; - private java.util.List person_; - public java.util.List getPersonList() { - return person_; - } - public java.util.List - getPersonOrBuilderList() { - return person_; - } - public int getPersonCount() { - return person_.size(); - } - public tutorial.Addressbook.Person getPerson(int index) { - return person_.get(index); - } - public tutorial.Addressbook.PersonOrBuilder getPersonOrBuilder( - int index) { - return person_.get(index); - } - - private void initFields() { - person_ = java.util.Collections.emptyList(); - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized != -1) return isInitialized == 1; - - for (int i = 0; i < getPersonCount(); i++) { - if (!getPerson(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - for (int i = 0; i < person_.size(); i++) { - output.writeMessage(1, person_.get(i)); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < person_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, person_.get(i)); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static tutorial.Addressbook.AddressBook parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); - } - public static tutorial.Addressbook.AddressBook parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); - } - public static tutorial.Addressbook.AddressBook parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); - } - public static tutorial.Addressbook.AddressBook parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); - } - public static tutorial.Addressbook.AddressBook parseFrom(java.io.InputStream input) - throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); - } - public static tutorial.Addressbook.AddressBook parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); - } - public static tutorial.Addressbook.AddressBook parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } - } - public static tutorial.Addressbook.AddressBook parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } - } - public static tutorial.Addressbook.AddressBook parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); - } - public static tutorial.Addressbook.AddressBook parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(tutorial.Addressbook.AddressBook prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder - implements tutorial.Addressbook.AddressBookOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return tutorial.Addressbook.internal_static_tutorial_AddressBook_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return tutorial.Addressbook.internal_static_tutorial_AddressBook_fieldAccessorTable; - } - - // Construct using tutorial.Addressbook.AddressBook.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - getPersonFieldBuilder(); - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - if (personBuilder_ == null) { - person_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - personBuilder_.clear(); - } - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return tutorial.Addressbook.AddressBook.getDescriptor(); - } - - public tutorial.Addressbook.AddressBook getDefaultInstanceForType() { - return tutorial.Addressbook.AddressBook.getDefaultInstance(); - } - - public tutorial.Addressbook.AddressBook build() { - tutorial.Addressbook.AddressBook result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - private tutorial.Addressbook.AddressBook buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - tutorial.Addressbook.AddressBook result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return result; - } - - public tutorial.Addressbook.AddressBook buildPartial() { - tutorial.Addressbook.AddressBook result = new tutorial.Addressbook.AddressBook(this); - int from_bitField0_ = bitField0_; - if (personBuilder_ == null) { - if (((bitField0_ & 0x00000001) == 0x00000001)) { - person_ = java.util.Collections.unmodifiableList(person_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.person_ = person_; - } else { - result.person_ = personBuilder_.build(); - } - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof tutorial.Addressbook.AddressBook) { - return mergeFrom((tutorial.Addressbook.AddressBook)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(tutorial.Addressbook.AddressBook other) { - if (other == tutorial.Addressbook.AddressBook.getDefaultInstance()) return this; - if (personBuilder_ == null) { - if (!other.person_.isEmpty()) { - if (person_.isEmpty()) { - person_ = other.person_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensurePersonIsMutable(); - person_.addAll(other.person_); - } - onChanged(); - } - } else { - if (!other.person_.isEmpty()) { - if (personBuilder_.isEmpty()) { - personBuilder_.dispose(); - personBuilder_ = null; - person_ = other.person_; - bitField0_ = (bitField0_ & ~0x00000001); - personBuilder_ = - com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? - getPersonFieldBuilder() : null; - } else { - personBuilder_.addAllMessages(other.person_); - } - } - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - for (int i = 0; i < getPersonCount(); i++) { - if (!getPerson(i).isInitialized()) { - - return false; - } - } - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder( - this.getUnknownFields()); - while (true) { - int tag = input.readTag(); - switch (tag) { - case 0: - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - } - break; - } - case 10: { - tutorial.Addressbook.Person.Builder subBuilder = tutorial.Addressbook.Person.newBuilder(); - input.readMessage(subBuilder, extensionRegistry); - addPerson(subBuilder.buildPartial()); - break; - } - } - } - } - - private int bitField0_; - - // repeated .tutorial.Person person = 1; - private java.util.List person_ = - java.util.Collections.emptyList(); - private void ensurePersonIsMutable() { - if (!((bitField0_ & 0x00000001) == 0x00000001)) { - person_ = new java.util.ArrayList(person_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilder< - tutorial.Addressbook.Person, tutorial.Addressbook.Person.Builder, tutorial.Addressbook.PersonOrBuilder> personBuilder_; - - public java.util.List getPersonList() { - if (personBuilder_ == null) { - return java.util.Collections.unmodifiableList(person_); - } else { - return personBuilder_.getMessageList(); - } - } - public int getPersonCount() { - if (personBuilder_ == null) { - return person_.size(); - } else { - return personBuilder_.getCount(); - } - } - public tutorial.Addressbook.Person getPerson(int index) { - if (personBuilder_ == null) { - return person_.get(index); - } else { - return personBuilder_.getMessage(index); - } - } - public Builder setPerson( - int index, tutorial.Addressbook.Person value) { - if (personBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePersonIsMutable(); - person_.set(index, value); - onChanged(); - } else { - personBuilder_.setMessage(index, value); - } - return this; - } - public Builder setPerson( - int index, tutorial.Addressbook.Person.Builder builderForValue) { - if (personBuilder_ == null) { - ensurePersonIsMutable(); - person_.set(index, builderForValue.build()); - onChanged(); - } else { - personBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - public Builder addPerson(tutorial.Addressbook.Person value) { - if (personBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePersonIsMutable(); - person_.add(value); - onChanged(); - } else { - personBuilder_.addMessage(value); - } - return this; - } - public Builder addPerson( - int index, tutorial.Addressbook.Person value) { - if (personBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePersonIsMutable(); - person_.add(index, value); - onChanged(); - } else { - personBuilder_.addMessage(index, value); - } - return this; - } - public Builder addPerson( - tutorial.Addressbook.Person.Builder builderForValue) { - if (personBuilder_ == null) { - ensurePersonIsMutable(); - person_.add(builderForValue.build()); - onChanged(); - } else { - personBuilder_.addMessage(builderForValue.build()); - } - return this; - } - public Builder addPerson( - int index, tutorial.Addressbook.Person.Builder builderForValue) { - if (personBuilder_ == null) { - ensurePersonIsMutable(); - person_.add(index, builderForValue.build()); - onChanged(); - } else { - personBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - public Builder addAllPerson( - java.lang.Iterable values) { - if (personBuilder_ == null) { - ensurePersonIsMutable(); - super.addAll(values, person_); - onChanged(); - } else { - personBuilder_.addAllMessages(values); - } - return this; - } - public Builder clearPerson() { - if (personBuilder_ == null) { - person_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - personBuilder_.clear(); - } - return this; - } - public Builder removePerson(int index) { - if (personBuilder_ == null) { - ensurePersonIsMutable(); - person_.remove(index); - onChanged(); - } else { - personBuilder_.remove(index); - } - return this; - } - public tutorial.Addressbook.Person.Builder getPersonBuilder( - int index) { - return getPersonFieldBuilder().getBuilder(index); - } - public tutorial.Addressbook.PersonOrBuilder getPersonOrBuilder( - int index) { - if (personBuilder_ == null) { - return person_.get(index); } else { - return personBuilder_.getMessageOrBuilder(index); - } - } - public java.util.List - getPersonOrBuilderList() { - if (personBuilder_ != null) { - return personBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(person_); - } - } - public tutorial.Addressbook.Person.Builder addPersonBuilder() { - return getPersonFieldBuilder().addBuilder( - tutorial.Addressbook.Person.getDefaultInstance()); - } - public tutorial.Addressbook.Person.Builder addPersonBuilder( - int index) { - return getPersonFieldBuilder().addBuilder( - index, tutorial.Addressbook.Person.getDefaultInstance()); - } - public java.util.List - getPersonBuilderList() { - return getPersonFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilder< - tutorial.Addressbook.Person, tutorial.Addressbook.Person.Builder, tutorial.Addressbook.PersonOrBuilder> - getPersonFieldBuilder() { - if (personBuilder_ == null) { - personBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - tutorial.Addressbook.Person, tutorial.Addressbook.Person.Builder, tutorial.Addressbook.PersonOrBuilder>( - person_, - ((bitField0_ & 0x00000001) == 0x00000001), - getParentForChildren(), - isClean()); - person_ = null; - } - return personBuilder_; - } - - // @@protoc_insertion_point(builder_scope:tutorial.AddressBook) - } - - static { - defaultInstance = new AddressBook(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:tutorial.AddressBook) - } - - private static com.google.protobuf.Descriptors.Descriptor - internal_static_tutorial_Person_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_tutorial_Person_fieldAccessorTable; - private static com.google.protobuf.Descriptors.Descriptor - internal_static_tutorial_Person_PhoneNumber_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_tutorial_Person_PhoneNumber_fieldAccessorTable; - private static com.google.protobuf.Descriptors.Descriptor - internal_static_tutorial_AddressBook_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_tutorial_AddressBook_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n\021addressbook.proto\022\010tutorial\"\200\002\n\006Person" + - "\022\014\n\004name\030\001 \002(\t\022\n\n\002id\030\002 \002(\005\022\r\n\005email\030\003 \001(" + - "\t\022$\n\004type\030\004 \001(\0162\020.tutorial.Gender:\004NONE\022" + - "+\n\005phone\030\005 \003(\0132\034.tutorial.Person.PhoneNu" + - "mber\032M\n\013PhoneNumber\022\016\n\006number\030\001 \002(\t\022.\n\004t" + - "ype\030\002 \001(\0162\032.tutorial.Person.PhoneType:\004H" + - "OME\"+\n\tPhoneType\022\n\n\006MOBILE\020\000\022\010\n\004HOME\020\001\022\010" + - "\n\004WORK\020\002\"/\n\013AddressBook\022 \n\006person\030\001 \003(\0132" + - "\020.tutorial.Person*3\n\006Gender\022\010\n\004NONE\020\000\022\010\n" + - "\004MALE\020\001\022\n\n\006FEMALE\020\002\022\t\n\005OTHER\020\003" - }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = - new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - internal_static_tutorial_Person_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tutorial_Person_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_tutorial_Person_descriptor, - new java.lang.String[] { "Name", "Id", "Email", "Type", "Phone", }, - tutorial.Addressbook.Person.class, - tutorial.Addressbook.Person.Builder.class); - internal_static_tutorial_Person_PhoneNumber_descriptor = - internal_static_tutorial_Person_descriptor.getNestedTypes().get(0); - internal_static_tutorial_Person_PhoneNumber_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_tutorial_Person_PhoneNumber_descriptor, - new java.lang.String[] { "Number", "Type", }, - tutorial.Addressbook.Person.PhoneNumber.class, - tutorial.Addressbook.Person.PhoneNumber.Builder.class); - internal_static_tutorial_AddressBook_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_tutorial_AddressBook_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_tutorial_AddressBook_descriptor, - new java.lang.String[] { "Person", }, - tutorial.Addressbook.AddressBook.class, - tutorial.Addressbook.AddressBook.Builder.class); - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }, assigner); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/protobuf/gen/py/tutorial/addressbook_pb2.py b/protobuf/gen/py/tutorial/addressbook_pb2.py deleted file mode 100644 index 19312ff..0000000 --- a/protobuf/gen/py/tutorial/addressbook_pb2.py +++ /dev/null @@ -1,223 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! - -from google.protobuf import descriptor -from google.protobuf import message -from google.protobuf import reflection -from google.protobuf import descriptor_pb2 -# @@protoc_insertion_point(imports) - - - -DESCRIPTOR = descriptor.FileDescriptor( - name='addressbook.proto', - package='tutorial', - serialized_pb='\n\x11\x61\x64\x64ressbook.proto\x12\x08tutorial\"\x80\x02\n\x06Person\x12\x0c\n\x04name\x18\x01 \x02(\t\x12\n\n\x02id\x18\x02 \x02(\x05\x12\r\n\x05\x65mail\x18\x03 \x01(\t\x12$\n\x04type\x18\x04 \x01(\x0e\x32\x10.tutorial.Gender:\x04NONE\x12+\n\x05phone\x18\x05 \x03(\x0b\x32\x1c.tutorial.Person.PhoneNumber\x1aM\n\x0bPhoneNumber\x12\x0e\n\x06number\x18\x01 \x02(\t\x12.\n\x04type\x18\x02 \x01(\x0e\x32\x1a.tutorial.Person.PhoneType:\x04HOME\"+\n\tPhoneType\x12\n\n\x06MOBILE\x10\x00\x12\x08\n\x04HOME\x10\x01\x12\x08\n\x04WORK\x10\x02\"/\n\x0b\x41\x64\x64ressBook\x12 \n\x06person\x18\x01 \x03(\x0b\x32\x10.tutorial.Person*3\n\x06Gender\x12\x08\n\x04NONE\x10\x00\x12\x08\n\x04MALE\x10\x01\x12\n\n\x06\x46\x45MALE\x10\x02\x12\t\n\x05OTHER\x10\x03') - -_GENDER = descriptor.EnumDescriptor( - name='Gender', - full_name='tutorial.Gender', - filename=None, - file=DESCRIPTOR, - values=[ - descriptor.EnumValueDescriptor( - name='NONE', index=0, number=0, - options=None, - type=None), - descriptor.EnumValueDescriptor( - name='MALE', index=1, number=1, - options=None, - type=None), - descriptor.EnumValueDescriptor( - name='FEMALE', index=2, number=2, - options=None, - type=None), - descriptor.EnumValueDescriptor( - name='OTHER', index=3, number=3, - options=None, - type=None), - ], - containing_type=None, - options=None, - serialized_start=339, - serialized_end=390, -) - - -NONE = 0 -MALE = 1 -FEMALE = 2 -OTHER = 3 - - -_PERSON_PHONETYPE = descriptor.EnumDescriptor( - name='PhoneType', - full_name='tutorial.Person.PhoneType', - filename=None, - file=DESCRIPTOR, - values=[ - descriptor.EnumValueDescriptor( - name='MOBILE', index=0, number=0, - options=None, - type=None), - descriptor.EnumValueDescriptor( - name='HOME', index=1, number=1, - options=None, - type=None), - descriptor.EnumValueDescriptor( - name='WORK', index=2, number=2, - options=None, - type=None), - ], - containing_type=None, - options=None, - serialized_start=245, - serialized_end=288, -) - - -_PERSON_PHONENUMBER = descriptor.Descriptor( - name='PhoneNumber', - full_name='tutorial.Person.PhoneNumber', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - descriptor.FieldDescriptor( - name='number', full_name='tutorial.Person.PhoneNumber.number', index=0, - number=1, type=9, cpp_type=9, label=2, - has_default_value=False, default_value=unicode("", "utf-8"), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - descriptor.FieldDescriptor( - name='type', full_name='tutorial.Person.PhoneNumber.type', index=1, - number=2, type=14, cpp_type=8, label=1, - has_default_value=True, default_value=1, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - extension_ranges=[], - serialized_start=166, - serialized_end=243, -) - -_PERSON = descriptor.Descriptor( - name='Person', - full_name='tutorial.Person', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - descriptor.FieldDescriptor( - name='name', full_name='tutorial.Person.name', index=0, - number=1, type=9, cpp_type=9, label=2, - has_default_value=False, default_value=unicode("", "utf-8"), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - descriptor.FieldDescriptor( - name='id', full_name='tutorial.Person.id', index=1, - number=2, type=5, cpp_type=1, label=2, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - descriptor.FieldDescriptor( - name='email', full_name='tutorial.Person.email', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=unicode("", "utf-8"), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - descriptor.FieldDescriptor( - name='type', full_name='tutorial.Person.type', index=3, - number=4, type=14, cpp_type=8, label=1, - has_default_value=True, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - descriptor.FieldDescriptor( - name='phone', full_name='tutorial.Person.phone', index=4, - number=5, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[_PERSON_PHONENUMBER, ], - enum_types=[ - _PERSON_PHONETYPE, - ], - options=None, - is_extendable=False, - extension_ranges=[], - serialized_start=32, - serialized_end=288, -) - - -_ADDRESSBOOK = descriptor.Descriptor( - name='AddressBook', - full_name='tutorial.AddressBook', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - descriptor.FieldDescriptor( - name='person', full_name='tutorial.AddressBook.person', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - extension_ranges=[], - serialized_start=290, - serialized_end=337, -) - -_PERSON_PHONENUMBER.fields_by_name['type'].enum_type = _PERSON_PHONETYPE -_PERSON_PHONENUMBER.containing_type = _PERSON; -_PERSON.fields_by_name['type'].enum_type = _GENDER -_PERSON.fields_by_name['phone'].message_type = _PERSON_PHONENUMBER -_PERSON_PHONETYPE.containing_type = _PERSON; -_ADDRESSBOOK.fields_by_name['person'].message_type = _PERSON -DESCRIPTOR.message_types_by_name['Person'] = _PERSON -DESCRIPTOR.message_types_by_name['AddressBook'] = _ADDRESSBOOK - -class Person(message.Message): - __metaclass__ = reflection.GeneratedProtocolMessageType - - class PhoneNumber(message.Message): - __metaclass__ = reflection.GeneratedProtocolMessageType - DESCRIPTOR = _PERSON_PHONENUMBER - - # @@protoc_insertion_point(class_scope:tutorial.Person.PhoneNumber) - DESCRIPTOR = _PERSON - - # @@protoc_insertion_point(class_scope:tutorial.Person) - -class AddressBook(message.Message): - __metaclass__ = reflection.GeneratedProtocolMessageType - DESCRIPTOR = _ADDRESSBOOK - - # @@protoc_insertion_point(class_scope:tutorial.AddressBook) - -# @@protoc_insertion_point(module_scope)