Created
February 11, 2015 04:39
-
-
Save swankjesse/b146f806c03cf556c6ea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Generated by the protocol buffer compiler. DO NOT EDIT! | |
// source: publicobject/example/person.proto | |
package com.publicobject.example; | |
/** | |
* Protobuf type {@code publicobject.example.Person} | |
*/ | |
public final class Person extends | |
com.google.protobuf.GeneratedMessage implements | |
// @@protoc_insertion_point(message_implements:publicobject.example.Person) | |
PersonOrBuilder { | |
// Use Person.newBuilder() to construct. | |
private Person(com.google.protobuf.GeneratedMessage.Builder builder) { | |
super(builder); | |
} | |
private Person() { | |
name_ = ""; | |
id_ = 0; | |
email_ = ""; | |
phone_ = java.util.Collections.emptyList(); | |
} | |
@java.lang.Override | |
public final com.google.protobuf.UnknownFieldSet | |
getUnknownFields() { | |
return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); | |
} | |
private Person( | |
com.google.protobuf.CodedInputStream input, | |
com.google.protobuf.ExtensionRegistryLite extensionRegistry) | |
throws com.google.protobuf.InvalidProtocolBufferException { | |
this(); | |
int mutable_bitField0_ = 0; | |
try { | |
boolean done = false; | |
while (!done) { | |
int tag = input.readTag(); | |
switch (tag) { | |
case 0: | |
done = true; | |
break; | |
default: { | |
if (!input.skipField(tag)) { | |
done = true; | |
} | |
break; | |
} | |
case 10: { | |
com.google.protobuf.ByteString bs = input.readBytes(); | |
name_ = bs; | |
break; | |
} | |
case 16: { | |
id_ = input.readInt32(); | |
break; | |
} | |
case 26: { | |
com.google.protobuf.ByteString bs = input.readBytes(); | |
email_ = bs; | |
break; | |
} | |
case 34: { | |
if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { | |
phone_ = new java.util.ArrayList<com.publicobject.example.Person.PhoneNumber>(); | |
mutable_bitField0_ |= 0x00000008; | |
} | |
phone_.add(input.readMessage(com.publicobject.example.Person.PhoneNumber.PARSER, extensionRegistry)); | |
break; | |
} | |
case 42: { | |
if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) { | |
socialNetworkIdentities_ = com.google.protobuf.MapField.newMapField( | |
socialNetworkIdentitiesDefaultEntry); | |
mutable_bitField0_ |= 0x00000010; | |
} | |
com.google.protobuf.MapEntry<java.lang.String, java.lang.String> | |
socialNetworkIdentities = input.readMessage( | |
socialNetworkIdentitiesDefaultEntry.getParserForType(), extensionRegistry); | |
socialNetworkIdentities_.getMutableMap().put(socialNetworkIdentities.getKey(), socialNetworkIdentities.getValue()); | |
break; | |
} | |
} | |
} | |
} catch (com.google.protobuf.InvalidProtocolBufferException e) { | |
throw e.setUnfinishedMessage(this); | |
} catch (java.io.IOException e) { | |
throw new com.google.protobuf.InvalidProtocolBufferException( | |
e.getMessage()).setUnfinishedMessage(this); | |
} finally { | |
if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) { | |
phone_ = java.util.Collections.unmodifiableList(phone_); | |
} | |
makeExtensionsImmutable(); | |
} | |
} | |
public static final com.google.protobuf.Descriptors.Descriptor | |
getDescriptor() { | |
return com.publicobject.example.PersonOuterClass.internal_static_publicobject_example_Person_descriptor; | |
} | |
@SuppressWarnings({"rawtypes"}) | |
protected com.google.protobuf.MapField internalGetMapField( | |
int number) { | |
switch (number) { | |
case 5: | |
return socialNetworkIdentities_; | |
default: | |
throw new RuntimeException( | |
"Invalid map field number: " + number); | |
} | |
} | |
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable | |
internalGetFieldAccessorTable() { | |
return com.publicobject.example.PersonOuterClass.internal_static_publicobject_example_Person_fieldAccessorTable | |
.ensureFieldAccessorsInitialized( | |
com.publicobject.example.Person.class, com.publicobject.example.Person.Builder.class); | |
} | |
public static final com.google.protobuf.Parser<Person> PARSER = | |
new com.google.protobuf.AbstractParser<Person>() { | |
public Person parsePartialFrom( | |
com.google.protobuf.CodedInputStream input, | |
com.google.protobuf.ExtensionRegistryLite extensionRegistry) | |
throws com.google.protobuf.InvalidProtocolBufferException { | |
return new Person(input, extensionRegistry); | |
} | |
}; | |
@java.lang.Override | |
public com.google.protobuf.Parser<Person> getParserForType() { | |
return PARSER; | |
} | |
/** | |
* Protobuf enum {@code publicobject.example.Person.PhoneType} | |
*/ | |
public enum PhoneType | |
implements com.google.protobuf.ProtocolMessageEnum { | |
/** | |
* <code>UNKNOWN = 0;</code> | |
*/ | |
UNKNOWN(0, 0), | |
/** | |
* <code>MOBILE = 1;</code> | |
*/ | |
MOBILE(1, 1), | |
/** | |
* <code>HOME = 2;</code> | |
*/ | |
HOME(2, 2), | |
/** | |
* <code>WORK = 3;</code> | |
*/ | |
WORK(3, 3), | |
UNRECOGNIZED(-1, -1), | |
; | |
/** | |
* <code>UNKNOWN = 0;</code> | |
*/ | |
public static final int UNKNOWN_VALUE = 0; | |
/** | |
* <code>MOBILE = 1;</code> | |
*/ | |
public static final int MOBILE_VALUE = 1; | |
/** | |
* <code>HOME = 2;</code> | |
*/ | |
public static final int HOME_VALUE = 2; | |
/** | |
* <code>WORK = 3;</code> | |
*/ | |
public static final int WORK_VALUE = 3; | |
public final int getNumber() { | |
if (index == -1) { | |
throw new java.lang.IllegalArgumentException( | |
"Can't get the number of an unknown enum value."); | |
} | |
return value; | |
} | |
public static PhoneType valueOf(int value) { | |
switch (value) { | |
case 0: return UNKNOWN; | |
case 1: return MOBILE; | |
case 2: return HOME; | |
case 3: return WORK; | |
default: return null; | |
} | |
} | |
public static com.google.protobuf.Internal.EnumLiteMap<PhoneType> | |
internalGetValueMap() { | |
return internalValueMap; | |
} | |
private static com.google.protobuf.Internal.EnumLiteMap<PhoneType> | |
internalValueMap = | |
new com.google.protobuf.Internal.EnumLiteMap<PhoneType>() { | |
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 com.publicobject.example.Person.getDescriptor().getEnumTypes().get(0); | |
} | |
private static final PhoneType[] VALUES = values(); | |
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."); | |
} | |
if (desc.getIndex() == -1) { | |
return UNRECOGNIZED; | |
} | |
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:publicobject.example.Person.PhoneType) | |
} | |
public interface PhoneNumberOrBuilder extends | |
// @@protoc_insertion_point(interface_extends:publicobject.example.Person.PhoneNumber) | |
com.google.protobuf.MessageOrBuilder { | |
/** | |
* <code>optional string number = 1;</code> | |
* | |
* <pre> | |
* The user's phone number. | |
* </pre> | |
*/ | |
java.lang.String getNumber(); | |
/** | |
* <code>optional string number = 1;</code> | |
* | |
* <pre> | |
* The user's phone number. | |
* </pre> | |
*/ | |
com.google.protobuf.ByteString | |
getNumberBytes(); | |
/** | |
* <code>optional .publicobject.example.Person.PhoneType type = 2;</code> | |
* | |
* <pre> | |
* The type of phone stored here. | |
* </pre> | |
*/ | |
int getTypeValue(); | |
/** | |
* <code>optional .publicobject.example.Person.PhoneType type = 2;</code> | |
* | |
* <pre> | |
* The type of phone stored here. | |
* </pre> | |
*/ | |
com.publicobject.example.Person.PhoneType getType(); | |
} | |
/** | |
* Protobuf type {@code publicobject.example.Person.PhoneNumber} | |
*/ | |
public static final class PhoneNumber extends | |
com.google.protobuf.GeneratedMessage implements | |
// @@protoc_insertion_point(message_implements:publicobject.example.Person.PhoneNumber) | |
PhoneNumberOrBuilder { | |
// Use PhoneNumber.newBuilder() to construct. | |
private PhoneNumber(com.google.protobuf.GeneratedMessage.Builder builder) { | |
super(builder); | |
} | |
private PhoneNumber() { | |
number_ = ""; | |
type_ = 0; | |
} | |
@java.lang.Override | |
public final com.google.protobuf.UnknownFieldSet | |
getUnknownFields() { | |
return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); | |
} | |
private PhoneNumber( | |
com.google.protobuf.CodedInputStream input, | |
com.google.protobuf.ExtensionRegistryLite extensionRegistry) | |
throws com.google.protobuf.InvalidProtocolBufferException { | |
this(); | |
int mutable_bitField0_ = 0; | |
try { | |
boolean done = false; | |
while (!done) { | |
int tag = input.readTag(); | |
switch (tag) { | |
case 0: | |
done = true; | |
break; | |
default: { | |
if (!input.skipField(tag)) { | |
done = true; | |
} | |
break; | |
} | |
case 10: { | |
com.google.protobuf.ByteString bs = input.readBytes(); | |
number_ = bs; | |
break; | |
} | |
case 16: { | |
int rawValue = input.readEnum(); | |
type_ = rawValue; | |
break; | |
} | |
} | |
} | |
} catch (com.google.protobuf.InvalidProtocolBufferException e) { | |
throw e.setUnfinishedMessage(this); | |
} catch (java.io.IOException e) { | |
throw new com.google.protobuf.InvalidProtocolBufferException( | |
e.getMessage()).setUnfinishedMessage(this); | |
} finally { | |
makeExtensionsImmutable(); | |
} | |
} | |
public static final com.google.protobuf.Descriptors.Descriptor | |
getDescriptor() { | |
return com.publicobject.example.PersonOuterClass.internal_static_publicobject_example_Person_PhoneNumber_descriptor; | |
} | |
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable | |
internalGetFieldAccessorTable() { | |
return com.publicobject.example.PersonOuterClass.internal_static_publicobject_example_Person_PhoneNumber_fieldAccessorTable | |
.ensureFieldAccessorsInitialized( | |
com.publicobject.example.Person.PhoneNumber.class, com.publicobject.example.Person.PhoneNumber.Builder.class); | |
} | |
public static final com.google.protobuf.Parser<PhoneNumber> PARSER = | |
new com.google.protobuf.AbstractParser<PhoneNumber>() { | |
public PhoneNumber parsePartialFrom( | |
com.google.protobuf.CodedInputStream input, | |
com.google.protobuf.ExtensionRegistryLite extensionRegistry) | |
throws com.google.protobuf.InvalidProtocolBufferException { | |
return new PhoneNumber(input, extensionRegistry); | |
} | |
}; | |
@java.lang.Override | |
public com.google.protobuf.Parser<PhoneNumber> getParserForType() { | |
return PARSER; | |
} | |
public static final int NUMBER_FIELD_NUMBER = 1; | |
private java.lang.Object number_; | |
/** | |
* <code>optional string number = 1;</code> | |
* | |
* <pre> | |
* The user's phone number. | |
* </pre> | |
*/ | |
public java.lang.String getNumber() { | |
java.lang.Object ref = number_; | |
if (ref instanceof java.lang.String) { | |
return (java.lang.String) ref; | |
} else { | |
com.google.protobuf.ByteString bs = | |
(com.google.protobuf.ByteString) ref; | |
java.lang.String s = bs.toStringUtf8(); | |
if (bs.isValidUtf8()) { | |
number_ = s; | |
} | |
return s; | |
} | |
} | |
/** | |
* <code>optional string number = 1;</code> | |
* | |
* <pre> | |
* The user's phone number. | |
* </pre> | |
*/ | |
public com.google.protobuf.ByteString | |
getNumberBytes() { | |
java.lang.Object ref = number_; | |
if (ref instanceof java.lang.String) { | |
com.google.protobuf.ByteString b = | |
com.google.protobuf.ByteString.copyFromUtf8( | |
(java.lang.String) ref); | |
number_ = b; | |
return b; | |
} else { | |
return (com.google.protobuf.ByteString) ref; | |
} | |
} | |
public static final int TYPE_FIELD_NUMBER = 2; | |
private int type_; | |
/** | |
* <code>optional .publicobject.example.Person.PhoneType type = 2;</code> | |
* | |
* <pre> | |
* The type of phone stored here. | |
* </pre> | |
*/ | |
public int getTypeValue() { | |
return type_; | |
} | |
/** | |
* <code>optional .publicobject.example.Person.PhoneType type = 2;</code> | |
* | |
* <pre> | |
* The type of phone stored here. | |
* </pre> | |
*/ | |
public com.publicobject.example.Person.PhoneType getType() { | |
com.publicobject.example.Person.PhoneType result = com.publicobject.example.Person.PhoneType.valueOf(type_); | |
return result == null ? com.publicobject.example.Person.PhoneType.UNRECOGNIZED : result; | |
} | |
private byte memoizedIsInitialized = -1; | |
public final boolean isInitialized() { | |
byte isInitialized = memoizedIsInitialized; | |
if (isInitialized == 1) return true; | |
if (isInitialized == 0) return false; | |
memoizedIsInitialized = 1; | |
return true; | |
} | |
public void writeTo(com.google.protobuf.CodedOutputStream output) | |
throws java.io.IOException { | |
getSerializedSize(); | |
if (!getNumberBytes().isEmpty()) { | |
output.writeBytes(1, getNumberBytes()); | |
} | |
if (type_ != com.publicobject.example.Person.PhoneType.UNKNOWN.getNumber()) { | |
output.writeEnum(2, type_); | |
} | |
} | |
private int memoizedSerializedSize = -1; | |
public int getSerializedSize() { | |
int size = memoizedSerializedSize; | |
if (size != -1) return size; | |
size = 0; | |
if (!getNumberBytes().isEmpty()) { | |
size += com.google.protobuf.CodedOutputStream | |
.computeBytesSize(1, getNumberBytes()); | |
} | |
if (type_ != com.publicobject.example.Person.PhoneType.UNKNOWN.getNumber()) { | |
size += com.google.protobuf.CodedOutputStream | |
.computeEnumSize(2, type_); | |
} | |
memoizedSerializedSize = size; | |
return size; | |
} | |
private static final long serialVersionUID = 0L; | |
public static com.publicobject.example.Person.PhoneNumber parseFrom( | |
com.google.protobuf.ByteString data) | |
throws com.google.protobuf.InvalidProtocolBufferException { | |
return PARSER.parseFrom(data); | |
} | |
public static com.publicobject.example.Person.PhoneNumber parseFrom( | |
com.google.protobuf.ByteString data, | |
com.google.protobuf.ExtensionRegistryLite extensionRegistry) | |
throws com.google.protobuf.InvalidProtocolBufferException { | |
return PARSER.parseFrom(data, extensionRegistry); | |
} | |
public static com.publicobject.example.Person.PhoneNumber parseFrom(byte[] data) | |
throws com.google.protobuf.InvalidProtocolBufferException { | |
return PARSER.parseFrom(data); | |
} | |
public static com.publicobject.example.Person.PhoneNumber parseFrom( | |
byte[] data, | |
com.google.protobuf.ExtensionRegistryLite extensionRegistry) | |
throws com.google.protobuf.InvalidProtocolBufferException { | |
return PARSER.parseFrom(data, extensionRegistry); | |
} | |
public static com.publicobject.example.Person.PhoneNumber parseFrom(java.io.InputStream input) | |
throws java.io.IOException { | |
return PARSER.parseFrom(input); | |
} | |
public static com.publicobject.example.Person.PhoneNumber parseFrom( | |
java.io.InputStream input, | |
com.google.protobuf.ExtensionRegistryLite extensionRegistry) | |
throws java.io.IOException { | |
return PARSER.parseFrom(input, extensionRegistry); | |
} | |
public static com.publicobject.example.Person.PhoneNumber parseDelimitedFrom(java.io.InputStream input) | |
throws java.io.IOException { | |
return PARSER.parseDelimitedFrom(input); | |
} | |
public static com.publicobject.example.Person.PhoneNumber parseDelimitedFrom( | |
java.io.InputStream input, | |
com.google.protobuf.ExtensionRegistryLite extensionRegistry) | |
throws java.io.IOException { | |
return PARSER.parseDelimitedFrom(input, extensionRegistry); | |
} | |
public static com.publicobject.example.Person.PhoneNumber parseFrom( | |
com.google.protobuf.CodedInputStream input) | |
throws java.io.IOException { | |
return PARSER.parseFrom(input); | |
} | |
public static com.publicobject.example.Person.PhoneNumber parseFrom( | |
com.google.protobuf.CodedInputStream input, | |
com.google.protobuf.ExtensionRegistryLite extensionRegistry) | |
throws java.io.IOException { | |
return PARSER.parseFrom(input, extensionRegistry); | |
} | |
public static Builder newBuilder() { return new Builder(); } | |
public Builder newBuilderForType() { return newBuilder(); } | |
public static Builder newBuilder(com.publicobject.example.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; | |
} | |
/** | |
* Protobuf type {@code publicobject.example.Person.PhoneNumber} | |
*/ | |
public static final class Builder extends | |
com.google.protobuf.GeneratedMessage.Builder<Builder> implements | |
// @@protoc_insertion_point(builder_implements:publicobject.example.Person.PhoneNumber) | |
com.publicobject.example.Person.PhoneNumberOrBuilder { | |
public static final com.google.protobuf.Descriptors.Descriptor | |
getDescriptor() { | |
return com.publicobject.example.PersonOuterClass.internal_static_publicobject_example_Person_PhoneNumber_descriptor; | |
} | |
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable | |
internalGetFieldAccessorTable() { | |
return com.publicobject.example.PersonOuterClass.internal_static_publicobject_example_Person_PhoneNumber_fieldAccessorTable | |
.ensureFieldAccessorsInitialized( | |
com.publicobject.example.Person.PhoneNumber.class, com.publicobject.example.Person.PhoneNumber.Builder.class); | |
} | |
// Construct using com.publicobject.example.Person.PhoneNumber.newBuilder() | |
private Builder() { | |
maybeForceBuilderInitialization(); | |
} | |
private Builder( | |
com.google.protobuf.GeneratedMessage.BuilderParent parent) { | |
super(parent); | |
maybeForceBuilderInitialization(); | |
} | |
private void maybeForceBuilderInitialization() { | |
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { | |
} | |
} | |
public Builder clear() { | |
super.clear(); | |
number_ = ""; | |
type_ = 0; | |
return this; | |
} | |
public com.google.protobuf.Descriptors.Descriptor | |
getDescriptorForType() { | |
return com.publicobject.example.PersonOuterClass.internal_static_publicobject_example_Person_PhoneNumber_descriptor; | |
} | |
public com.publicobject.example.Person.PhoneNumber getDefaultInstanceForType() { | |
return com.publicobject.example.Person.PhoneNumber.getDefaultInstance(); | |
} | |
public com.publicobject.example.Person.PhoneNumber build() { | |
com.publicobject.example.Person.PhoneNumber result = buildPartial(); | |
if (!result.isInitialized()) { | |
throw newUninitializedMessageException(result); | |
} | |
return result; | |
} | |
public com.publicobject.example.Person.PhoneNumber buildPartial() { | |
com.publicobject.example.Person.PhoneNumber result = new com.publicobject.example.Person.PhoneNumber(this); | |
result.number_ = number_; | |
result.type_ = type_; | |
onBuilt(); | |
return result; | |
} | |
public Builder mergeFrom(com.google.protobuf.Message other) { | |
if (other instanceof com.publicobject.example.Person.PhoneNumber) { | |
return mergeFrom((com.publicobject.example.Person.PhoneNumber)other); | |
} else { | |
super.mergeFrom(other); | |
return this; | |
} | |
} | |
public Builder mergeFrom(com.publicobject.example.Person.PhoneNumber other) { | |
if (other == com.publicobject.example.Person.PhoneNumber.getDefaultInstance()) return this; | |
if (!other.getNumber().isEmpty()) { | |
number_ = other.number_; | |
onChanged(); | |
} | |
if (other.type_ != 0) { | |
setTypeValue(other.getTypeValue()); | |
} | |
onChanged(); | |
return this; | |
} | |
public final boolean isInitialized() { | |
return true; | |
} | |
public Builder mergeFrom( | |
com.google.protobuf.CodedInputStream input, | |
com.google.protobuf.ExtensionRegistryLite extensionRegistry) | |
throws java.io.IOException { | |
com.publicobject.example.Person.PhoneNumber parsedMessage = null; | |
try { | |
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); | |
} catch (com.google.protobuf.InvalidProtocolBufferException e) { | |
parsedMessage = (com.publicobject.example.Person.PhoneNumber) e.getUnfinishedMessage(); | |
throw e; | |
} finally { | |
if (parsedMessage != null) { | |
mergeFrom(parsedMessage); | |
} | |
} | |
return this; | |
} | |
private java.lang.Object number_ = ""; | |
/** | |
* <code>optional string number = 1;</code> | |
* | |
* <pre> | |
* The user's phone number. | |
* </pre> | |
*/ | |
public java.lang.String getNumber() { | |
java.lang.Object ref = number_; | |
if (!(ref instanceof java.lang.String)) { | |
com.google.protobuf.ByteString bs = | |
(com.google.protobuf.ByteString) ref; | |
java.lang.String s = bs.toStringUtf8(); | |
if (bs.isValidUtf8()) { | |
number_ = s; | |
} | |
return s; | |
} else { | |
return (java.lang.String) ref; | |
} | |
} | |
/** | |
* <code>optional string number = 1;</code> | |
* | |
* <pre> | |
* The user's phone number. | |
* </pre> | |
*/ | |
public com.google.protobuf.ByteString | |
getNumberBytes() { | |
java.lang.Object ref = number_; | |
if (ref instanceof String) { | |
com.google.protobuf.ByteString b = | |
com.google.protobuf.ByteString.copyFromUtf8( | |
(java.lang.String) ref); | |
number_ = b; | |
return b; | |
} else { | |
return (com.google.protobuf.ByteString) ref; | |
} | |
} | |
/** | |
* <code>optional string number = 1;</code> | |
* | |
* <pre> | |
* The user's phone number. | |
* </pre> | |
*/ | |
public Builder setNumber( | |
java.lang.String value) { | |
if (value == null) { | |
throw new NullPointerException(); | |
} | |
number_ = value; | |
onChanged(); | |
return this; | |
} | |
/** | |
* <code>optional string number = 1;</code> | |
* | |
* <pre> | |
* The user's phone number. | |
* </pre> | |
*/ | |
public Builder clearNumber() { | |
number_ = getDefaultInstance().getNumber(); | |
onChanged(); | |
return this; | |
} | |
/** | |
* <code>optional string number = 1;</code> | |
* | |
* <pre> | |
* The user's phone number. | |
* </pre> | |
*/ | |
public Builder setNumberBytes( | |
com.google.protobuf.ByteString value) { | |
if (value == null) { | |
throw new NullPointerException(); | |
} | |
number_ = value; | |
onChanged(); | |
return this; | |
} | |
private int type_ = 0; | |
/** | |
* <code>optional .publicobject.example.Person.PhoneType type = 2;</code> | |
* | |
* <pre> | |
* The type of phone stored here. | |
* </pre> | |
*/ | |
public int getTypeValue() { | |
return type_; | |
} | |
/** | |
* <code>optional .publicobject.example.Person.PhoneType type = 2;</code> | |
* | |
* <pre> | |
* The type of phone stored here. | |
* </pre> | |
*/ | |
public Builder setTypeValue(int value) { | |
type_ = value; | |
onChanged(); | |
return this; | |
} | |
/** | |
* <code>optional .publicobject.example.Person.PhoneType type = 2;</code> | |
* | |
* <pre> | |
* The type of phone stored here. | |
* </pre> | |
*/ | |
public com.publicobject.example.Person.PhoneType getType() { | |
com.publicobject.example.Person.PhoneType result = com.publicobject.example.Person.PhoneType.valueOf(type_); | |
return result == null ? com.publicobject.example.Person.PhoneType.UNRECOGNIZED : result; | |
} | |
/** | |
* <code>optional .publicobject.example.Person.PhoneType type = 2;</code> | |
* | |
* <pre> | |
* The type of phone stored here. | |
* </pre> | |
*/ | |
public Builder setType(com.publicobject.example.Person.PhoneType value) { | |
if (value == null) { | |
throw new NullPointerException(); | |
} | |
type_ = value.getNumber(); | |
onChanged(); | |
return this; | |
} | |
/** | |
* <code>optional .publicobject.example.Person.PhoneType type = 2;</code> | |
* | |
* <pre> | |
* The type of phone stored here. | |
* </pre> | |
*/ | |
public Builder clearType() { | |
type_ = 0; | |
onChanged(); | |
return this; | |
} | |
public final Builder setUnknownFields( | |
final com.google.protobuf.UnknownFieldSet unknownFields) { | |
return this; | |
} | |
public final Builder mergeUnknownFields( | |
final com.google.protobuf.UnknownFieldSet unknownFields) { | |
return this; | |
} | |
// @@protoc_insertion_point(builder_scope:publicobject.example.Person.PhoneNumber) | |
} | |
// @@protoc_insertion_point(class_scope:publicobject.example.Person.PhoneNumber) | |
private static final com.publicobject.example.Person.PhoneNumber defaultInstance;static { | |
defaultInstance = new com.publicobject.example.Person.PhoneNumber(); | |
} | |
public static com.publicobject.example.Person.PhoneNumber getDefaultInstance() { | |
return defaultInstance; | |
} | |
public com.publicobject.example.Person.PhoneNumber getDefaultInstanceForType() { | |
return defaultInstance; | |
} | |
} | |
private int bitField0_; | |
public static final int NAME_FIELD_NUMBER = 1; | |
private java.lang.Object name_; | |
/** | |
* <code>optional string name = 1;</code> | |
* | |
* <pre> | |
* The customer's full name. | |
* </pre> | |
*/ | |
public java.lang.String getName() { | |
java.lang.Object ref = name_; | |
if (ref instanceof java.lang.String) { | |
return (java.lang.String) ref; | |
} else { | |
com.google.protobuf.ByteString bs = | |
(com.google.protobuf.ByteString) ref; | |
java.lang.String s = bs.toStringUtf8(); | |
if (bs.isValidUtf8()) { | |
name_ = s; | |
} | |
return s; | |
} | |
} | |
/** | |
* <code>optional string name = 1;</code> | |
* | |
* <pre> | |
* The customer's full name. | |
* </pre> | |
*/ | |
public com.google.protobuf.ByteString | |
getNameBytes() { | |
java.lang.Object ref = name_; | |
if (ref instanceof java.lang.String) { | |
com.google.protobuf.ByteString b = | |
com.google.protobuf.ByteString.copyFromUtf8( | |
(java.lang.String) ref); | |
name_ = b; | |
return b; | |
} else { | |
return (com.google.protobuf.ByteString) ref; | |
} | |
} | |
public static final int ID_FIELD_NUMBER = 2; | |
private int id_; | |
/** | |
* <code>optional int32 id = 2;</code> | |
* | |
* <pre> | |
* The customer's ID number. | |
* </pre> | |
*/ | |
public int getId() { | |
return id_; | |
} | |
public static final int EMAIL_FIELD_NUMBER = 3; | |
private java.lang.Object email_; | |
/** | |
* <code>optional string email = 3;</code> | |
* | |
* <pre> | |
* Email address for the customer. | |
* </pre> | |
*/ | |
public java.lang.String getEmail() { | |
java.lang.Object ref = email_; | |
if (ref instanceof java.lang.String) { | |
return (java.lang.String) ref; | |
} else { | |
com.google.protobuf.ByteString bs = | |
(com.google.protobuf.ByteString) ref; | |
java.lang.String s = bs.toStringUtf8(); | |
if (bs.isValidUtf8()) { | |
email_ = s; | |
} | |
return s; | |
} | |
} | |
/** | |
* <code>optional string email = 3;</code> | |
* | |
* <pre> | |
* Email address for the customer. | |
* </pre> | |
*/ | |
public com.google.protobuf.ByteString | |
getEmailBytes() { | |
java.lang.Object ref = email_; | |
if (ref instanceof java.lang.String) { | |
com.google.protobuf.ByteString b = | |
com.google.protobuf.ByteString.copyFromUtf8( | |
(java.lang.String) ref); | |
email_ = b; | |
return b; | |
} else { | |
return (com.google.protobuf.ByteString) ref; | |
} | |
} | |
public static final int PHONE_FIELD_NUMBER = 4; | |
private java.util.List<com.publicobject.example.Person.PhoneNumber> phone_; | |
/** | |
* <code>repeated .publicobject.example.Person.PhoneNumber phone = 4;</code> | |
* | |
* <pre> | |
* A list of the user's phone numbers. | |
* </pre> | |
*/ | |
public java.util.List<com.publicobject.example.Person.PhoneNumber> getPhoneList() { | |
return phone_; | |
} | |
/** | |
* <code>repeated .publicobject.example.Person.PhoneNumber phone = 4;</code> | |
* | |
* <pre> | |
* A list of the user's phone numbers. | |
* </pre> | |
*/ | |
public java.util.List<? extends com.publicobject.example.Person.PhoneNumberOrBuilder> | |
getPhoneOrBuilderList() { | |
return phone_; | |
} | |
/** | |
* <code>repeated .publicobject.example.Person.PhoneNumber phone = 4;</code> | |
* | |
* <pre> | |
* A list of the user's phone numbers. | |
* </pre> | |
*/ | |
public int getPhoneCount() { | |
return phone_.size(); | |
} | |
/** | |
* <code>repeated .publicobject.example.Person.PhoneNumber phone = 4;</code> | |
* | |
* <pre> | |
* A list of the user's phone numbers. | |
* </pre> | |
*/ | |
public com.publicobject.example.Person.PhoneNumber getPhone(int index) { | |
return phone_.get(index); | |
} | |
/** | |
* <code>repeated .publicobject.example.Person.PhoneNumber phone = 4;</code> | |
* | |
* <pre> | |
* A list of the user's phone numbers. | |
* </pre> | |
*/ | |
public com.publicobject.example.Person.PhoneNumberOrBuilder getPhoneOrBuilder( | |
int index) { | |
return phone_.get(index); | |
} | |
public static final int SOCIAL_NETWORK_IDENTITIES_FIELD_NUMBER = 5; | |
private static final com.google.protobuf.MapEntry< | |
java.lang.String, java.lang.String> socialNetworkIdentitiesDefaultEntry = | |
com.google.protobuf.MapEntry | |
.<java.lang.String, java.lang.String>newDefaultInstance( | |
com.publicobject.example.PersonOuterClass.internal_static_publicobject_example_Person_SocialNetworkIdentitiesEntry_descriptor, | |
com.google.protobuf.WireFormat.FieldType.STRING, | |
"", | |
com.google.protobuf.WireFormat.FieldType.STRING, | |
""); | |
private com.google.protobuf.MapField< | |
java.lang.String, java.lang.String> socialNetworkIdentities_ = | |
com.google.protobuf.MapField.emptyMapField( | |
socialNetworkIdentitiesDefaultEntry); | |
/** | |
* <code>map<string, string> social_network_identities = 5;</code> | |
*/ | |
public java.util.Map<java.lang.String, java.lang.String> getSocialNetworkIdentities() { | |
return socialNetworkIdentities_.getMap(); | |
} | |
private byte memoizedIsInitialized = -1; | |
public final boolean isInitialized() { | |
byte isInitialized = memoizedIsInitialized; | |
if (isInitialized == 1) return true; | |
if (isInitialized == 0) return false; | |
memoizedIsInitialized = 1; | |
return true; | |
} | |
public void writeTo(com.google.protobuf.CodedOutputStream output) | |
throws java.io.IOException { | |
getSerializedSize(); | |
if (!getNameBytes().isEmpty()) { | |
output.writeBytes(1, getNameBytes()); | |
} | |
if (id_ != 0) { | |
output.writeInt32(2, id_); | |
} | |
if (!getEmailBytes().isEmpty()) { | |
output.writeBytes(3, getEmailBytes()); | |
} | |
for (int i = 0; i < phone_.size(); i++) { | |
output.writeMessage(4, phone_.get(i)); | |
} | |
for (java.util.Map.Entry<java.lang.String, java.lang.String> entry | |
: socialNetworkIdentities_.getMap().entrySet()) { | |
com.google.protobuf.MapEntry<java.lang.String, java.lang.String> | |
socialNetworkIdentities = socialNetworkIdentitiesDefaultEntry.newBuilderForType() | |
.setKey(entry.getKey()) | |
.setValue(entry.getValue()) | |
.build(); | |
output.writeMessage(5, socialNetworkIdentities); | |
} | |
} | |
private int memoizedSerializedSize = -1; | |
public int getSerializedSize() { | |
int size = memoizedSerializedSize; | |
if (size != -1) return size; | |
size = 0; | |
if (!getNameBytes().isEmpty()) { | |
size += com.google.protobuf.CodedOutputStream | |
.computeBytesSize(1, getNameBytes()); | |
} | |
if (id_ != 0) { | |
size += com.google.protobuf.CodedOutputStream | |
.computeInt32Size(2, id_); | |
} | |
if (!getEmailBytes().isEmpty()) { | |
size += com.google.protobuf.CodedOutputStream | |
.computeBytesSize(3, getEmailBytes()); | |
} | |
for (int i = 0; i < phone_.size(); i++) { | |
size += com.google.protobuf.CodedOutputStream | |
.computeMessageSize(4, phone_.get(i)); | |
} | |
for (java.util.Map.Entry<java.lang.String, java.lang.String> entry | |
: socialNetworkIdentities_.getMap().entrySet()) { | |
com.google.protobuf.MapEntry<java.lang.String, java.lang.String> | |
socialNetworkIdentities = socialNetworkIdentitiesDefaultEntry.newBuilderForType() | |
.setKey(entry.getKey()) | |
.setValue(entry.getValue()) | |
.build(); | |
size += com.google.protobuf.CodedOutputStream | |
.computeMessageSize(5, socialNetworkIdentities); | |
} | |
memoizedSerializedSize = size; | |
return size; | |
} | |
private static final long serialVersionUID = 0L; | |
public static com.publicobject.example.Person parseFrom( | |
com.google.protobuf.ByteString data) | |
throws com.google.protobuf.InvalidProtocolBufferException { | |
return PARSER.parseFrom(data); | |
} | |
public static com.publicobject.example.Person parseFrom( | |
com.google.protobuf.ByteString data, | |
com.google.protobuf.ExtensionRegistryLite extensionRegistry) | |
throws com.google.protobuf.InvalidProtocolBufferException { | |
return PARSER.parseFrom(data, extensionRegistry); | |
} | |
public static com.publicobject.example.Person parseFrom(byte[] data) | |
throws com.google.protobuf.InvalidProtocolBufferException { | |
return PARSER.parseFrom(data); | |
} | |
public static com.publicobject.example.Person parseFrom( | |
byte[] data, | |
com.google.protobuf.ExtensionRegistryLite extensionRegistry) | |
throws com.google.protobuf.InvalidProtocolBufferException { | |
return PARSER.parseFrom(data, extensionRegistry); | |
} | |
public static com.publicobject.example.Person parseFrom(java.io.InputStream input) | |
throws java.io.IOException { | |
return PARSER.parseFrom(input); | |
} | |
public static com.publicobject.example.Person parseFrom( | |
java.io.InputStream input, | |
com.google.protobuf.ExtensionRegistryLite extensionRegistry) | |
throws java.io.IOException { | |
return PARSER.parseFrom(input, extensionRegistry); | |
} | |
public static com.publicobject.example.Person parseDelimitedFrom(java.io.InputStream input) | |
throws java.io.IOException { | |
return PARSER.parseDelimitedFrom(input); | |
} | |
public static com.publicobject.example.Person parseDelimitedFrom( | |
java.io.InputStream input, | |
com.google.protobuf.ExtensionRegistryLite extensionRegistry) | |
throws java.io.IOException { | |
return PARSER.parseDelimitedFrom(input, extensionRegistry); | |
} | |
public static com.publicobject.example.Person parseFrom( | |
com.google.protobuf.CodedInputStream input) | |
throws java.io.IOException { | |
return PARSER.parseFrom(input); | |
} | |
public static com.publicobject.example.Person parseFrom( | |
com.google.protobuf.CodedInputStream input, | |
com.google.protobuf.ExtensionRegistryLite extensionRegistry) | |
throws java.io.IOException { | |
return PARSER.parseFrom(input, extensionRegistry); | |
} | |
public static Builder newBuilder() { return new Builder(); } | |
public Builder newBuilderForType() { return newBuilder(); } | |
public static Builder newBuilder(com.publicobject.example.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; | |
} | |
/** | |
* Protobuf type {@code publicobject.example.Person} | |
*/ | |
public static final class Builder extends | |
com.google.protobuf.GeneratedMessage.Builder<Builder> implements | |
// @@protoc_insertion_point(builder_implements:publicobject.example.Person) | |
com.publicobject.example.PersonOrBuilder { | |
public static final com.google.protobuf.Descriptors.Descriptor | |
getDescriptor() { | |
return com.publicobject.example.PersonOuterClass.internal_static_publicobject_example_Person_descriptor; | |
} | |
@SuppressWarnings({"rawtypes"}) | |
protected com.google.protobuf.MapField internalGetMapField( | |
int number) { | |
switch (number) { | |
case 5: | |
return socialNetworkIdentities_; | |
default: | |
throw new RuntimeException( | |
"Invalid map field number: " + number); | |
} | |
} | |
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable | |
internalGetFieldAccessorTable() { | |
return com.publicobject.example.PersonOuterClass.internal_static_publicobject_example_Person_fieldAccessorTable | |
.ensureFieldAccessorsInitialized( | |
com.publicobject.example.Person.class, com.publicobject.example.Person.Builder.class); | |
} | |
// Construct using com.publicobject.example.Person.newBuilder() | |
private Builder() { | |
maybeForceBuilderInitialization(); | |
} | |
private Builder( | |
com.google.protobuf.GeneratedMessage.BuilderParent parent) { | |
super(parent); | |
maybeForceBuilderInitialization(); | |
} | |
private void maybeForceBuilderInitialization() { | |
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { | |
getPhoneFieldBuilder(); | |
} | |
} | |
public Builder clear() { | |
super.clear(); | |
name_ = ""; | |
id_ = 0; | |
email_ = ""; | |
if (phoneBuilder_ == null) { | |
phone_ = java.util.Collections.emptyList(); | |
bitField0_ = (bitField0_ & ~0x00000008); | |
} else { | |
phoneBuilder_.clear(); | |
} | |
socialNetworkIdentities_.clear(); | |
return this; | |
} | |
public com.google.protobuf.Descriptors.Descriptor | |
getDescriptorForType() { | |
return com.publicobject.example.PersonOuterClass.internal_static_publicobject_example_Person_descriptor; | |
} | |
public com.publicobject.example.Person getDefaultInstanceForType() { | |
return com.publicobject.example.Person.getDefaultInstance(); | |
} | |
public com.publicobject.example.Person build() { | |
com.publicobject.example.Person result = buildPartial(); | |
if (!result.isInitialized()) { | |
throw newUninitializedMessageException(result); | |
} | |
return result; | |
} | |
public com.publicobject.example.Person buildPartial() { | |
com.publicobject.example.Person result = new com.publicobject.example.Person(this); | |
int from_bitField0_ = bitField0_; | |
int to_bitField0_ = 0; | |
result.name_ = name_; | |
result.id_ = id_; | |
result.email_ = email_; | |
if (phoneBuilder_ == null) { | |
if (((bitField0_ & 0x00000008) == 0x00000008)) { | |
phone_ = java.util.Collections.unmodifiableList(phone_); | |
bitField0_ = (bitField0_ & ~0x00000008); | |
} | |
result.phone_ = phone_; | |
} else { | |
result.phone_ = phoneBuilder_.build(); | |
} | |
result.socialNetworkIdentities_ = socialNetworkIdentities_.copy(); | |
result.bitField0_ = to_bitField0_; | |
onBuilt(); | |
return result; | |
} | |
public Builder mergeFrom(com.google.protobuf.Message other) { | |
if (other instanceof com.publicobject.example.Person) { | |
return mergeFrom((com.publicobject.example.Person)other); | |
} else { | |
super.mergeFrom(other); | |
return this; | |
} | |
} | |
public Builder mergeFrom(com.publicobject.example.Person other) { | |
if (other == com.publicobject.example.Person.getDefaultInstance()) return this; | |
if (!other.getName().isEmpty()) { | |
name_ = other.name_; | |
onChanged(); | |
} | |
if (other.getId() != 0) { | |
setId(other.getId()); | |
} | |
if (!other.getEmail().isEmpty()) { | |
email_ = other.email_; | |
onChanged(); | |
} | |
if (phoneBuilder_ == null) { | |
if (!other.phone_.isEmpty()) { | |
if (phone_.isEmpty()) { | |
phone_ = other.phone_; | |
bitField0_ = (bitField0_ & ~0x00000008); | |
} else { | |
ensurePhoneIsMutable(); | |
phone_.addAll(other.phone_); | |
} | |
onChanged(); | |
} | |
} else { | |
if (!other.phone_.isEmpty()) { | |
if (phoneBuilder_.isEmpty()) { | |
phoneBuilder_.dispose(); | |
phoneBuilder_ = null; | |
phone_ = other.phone_; | |
bitField0_ = (bitField0_ & ~0x00000008); | |
phoneBuilder_ = | |
com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? | |
getPhoneFieldBuilder() : null; | |
} else { | |
phoneBuilder_.addAllMessages(other.phone_); | |
} | |
} | |
} | |
socialNetworkIdentities_.mergeFrom(other.socialNetworkIdentities_); | |
onChanged(); | |
return this; | |
} | |
public final boolean isInitialized() { | |
return true; | |
} | |
public Builder mergeFrom( | |
com.google.protobuf.CodedInputStream input, | |
com.google.protobuf.ExtensionRegistryLite extensionRegistry) | |
throws java.io.IOException { | |
com.publicobject.example.Person parsedMessage = null; | |
try { | |
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); | |
} catch (com.google.protobuf.InvalidProtocolBufferException e) { | |
parsedMessage = (com.publicobject.example.Person) e.getUnfinishedMessage(); | |
throw e; | |
} finally { | |
if (parsedMessage != null) { | |
mergeFrom(parsedMessage); | |
} | |
} | |
return this; | |
} | |
private int bitField0_; | |
private java.lang.Object name_ = ""; | |
/** | |
* <code>optional string name = 1;</code> | |
* | |
* <pre> | |
* The customer's full name. | |
* </pre> | |
*/ | |
public java.lang.String getName() { | |
java.lang.Object ref = name_; | |
if (!(ref instanceof java.lang.String)) { | |
com.google.protobuf.ByteString bs = | |
(com.google.protobuf.ByteString) ref; | |
java.lang.String s = bs.toStringUtf8(); | |
if (bs.isValidUtf8()) { | |
name_ = s; | |
} | |
return s; | |
} else { | |
return (java.lang.String) ref; | |
} | |
} | |
/** | |
* <code>optional string name = 1;</code> | |
* | |
* <pre> | |
* The customer's full name. | |
* </pre> | |
*/ | |
public com.google.protobuf.ByteString | |
getNameBytes() { | |
java.lang.Object ref = name_; | |
if (ref instanceof String) { | |
com.google.protobuf.ByteString b = | |
com.google.protobuf.ByteString.copyFromUtf8( | |
(java.lang.String) ref); | |
name_ = b; | |
return b; | |
} else { | |
return (com.google.protobuf.ByteString) ref; | |
} | |
} | |
/** | |
* <code>optional string name = 1;</code> | |
* | |
* <pre> | |
* The customer's full name. | |
* </pre> | |
*/ | |
public Builder setName( | |
java.lang.String value) { | |
if (value == null) { | |
throw new NullPointerException(); | |
} | |
name_ = value; | |
onChanged(); | |
return this; | |
} | |
/** | |
* <code>optional string name = 1;</code> | |
* | |
* <pre> | |
* The customer's full name. | |
* </pre> | |
*/ | |
public Builder clearName() { | |
name_ = getDefaultInstance().getName(); | |
onChanged(); | |
return this; | |
} | |
/** | |
* <code>optional string name = 1;</code> | |
* | |
* <pre> | |
* The customer's full name. | |
* </pre> | |
*/ | |
public Builder setNameBytes( | |
com.google.protobuf.ByteString value) { | |
if (value == null) { | |
throw new NullPointerException(); | |
} | |
name_ = value; | |
onChanged(); | |
return this; | |
} | |
private int id_ ; | |
/** | |
* <code>optional int32 id = 2;</code> | |
* | |
* <pre> | |
* The customer's ID number. | |
* </pre> | |
*/ | |
public int getId() { | |
return id_; | |
} | |
/** | |
* <code>optional int32 id = 2;</code> | |
* | |
* <pre> | |
* The customer's ID number. | |
* </pre> | |
*/ | |
public Builder setId(int value) { | |
id_ = value; | |
onChanged(); | |
return this; | |
} | |
/** | |
* <code>optional int32 id = 2;</code> | |
* | |
* <pre> | |
* The customer's ID number. | |
* </pre> | |
*/ | |
public Builder clearId() { | |
id_ = 0; | |
onChanged(); | |
return this; | |
} | |
private java.lang.Object email_ = ""; | |
/** | |
* <code>optional string email = 3;</code> | |
* | |
* <pre> | |
* Email address for the customer. | |
* </pre> | |
*/ | |
public java.lang.String getEmail() { | |
java.lang.Object ref = email_; | |
if (!(ref instanceof java.lang.String)) { | |
com.google.protobuf.ByteString bs = | |
(com.google.protobuf.ByteString) ref; | |
java.lang.String s = bs.toStringUtf8(); | |
if (bs.isValidUtf8()) { | |
email_ = s; | |
} | |
return s; | |
} else { | |
return (java.lang.String) ref; | |
} | |
} | |
/** | |
* <code>optional string email = 3;</code> | |
* | |
* <pre> | |
* Email address for the customer. | |
* </pre> | |
*/ | |
public com.google.protobuf.ByteString | |
getEmailBytes() { | |
java.lang.Object ref = email_; | |
if (ref instanceof String) { | |
com.google.protobuf.ByteString b = | |
com.google.protobuf.ByteString.copyFromUtf8( | |
(java.lang.String) ref); | |
email_ = b; | |
return b; | |
} else { | |
return (com.google.protobuf.ByteString) ref; | |
} | |
} | |
/** | |
* <code>optional string email = 3;</code> | |
* | |
* <pre> | |
* Email address for the customer. | |
* </pre> | |
*/ | |
public Builder setEmail( | |
java.lang.String value) { | |
if (value == null) { | |
throw new NullPointerException(); | |
} | |
email_ = value; | |
onChanged(); | |
return this; | |
} | |
/** | |
* <code>optional string email = 3;</code> | |
* | |
* <pre> | |
* Email address for the customer. | |
* </pre> | |
*/ | |
public Builder clearEmail() { | |
email_ = getDefaultInstance().getEmail(); | |
onChanged(); | |
return this; | |
} | |
/** | |
* <code>optional string email = 3;</code> | |
* | |
* <pre> | |
* Email address for the customer. | |
* </pre> | |
*/ | |
public Builder setEmailBytes( | |
com.google.protobuf.ByteString value) { | |
if (value == null) { | |
throw new NullPointerException(); | |
} | |
email_ = value; | |
onChanged(); | |
return this; | |
} | |
private java.util.List<com.publicobject.example.Person.PhoneNumber> phone_ = | |
java.util.Collections.emptyList(); | |
private void ensurePhoneIsMutable() { | |
if (!((bitField0_ & 0x00000008) == 0x00000008)) { | |
phone_ = new java.util.ArrayList<com.publicobject.example.Person.PhoneNumber>(phone_); | |
bitField0_ |= 0x00000008; | |
} | |
} | |
private com.google.protobuf.RepeatedFieldBuilder< | |
com.publicobject.example.Person.PhoneNumber, com.publicobject.example.Person.PhoneNumber.Builder, com.publicobject.example.Person.PhoneNumberOrBuilder> phoneBuilder_; | |
/** | |
* <code>repeated .publicobject.example.Person.PhoneNumber phone = 4;</code> | |
* | |
* <pre> | |
* A list of the user's phone numbers. | |
* </pre> | |
*/ | |
public java.util.List<com.publicobject.example.Person.PhoneNumber> getPhoneList() { | |
if (phoneBuilder_ == null) { | |
return java.util.Collections.unmodifiableList(phone_); | |
} else { | |
return phoneBuilder_.getMessageList(); | |
} | |
} | |
/** | |
* <code>repeated .publicobject.example.Person.PhoneNumber phone = 4;</code> | |
* | |
* <pre> | |
* A list of the user's phone numbers. | |
* </pre> | |
*/ | |
public int getPhoneCount() { | |
if (phoneBuilder_ == null) { | |
return phone_.size(); | |
} else { | |
return phoneBuilder_.getCount(); | |
} | |
} | |
/** | |
* <code>repeated .publicobject.example.Person.PhoneNumber phone = 4;</code> | |
* | |
* <pre> | |
* A list of the user's phone numbers. | |
* </pre> | |
*/ | |
public com.publicobject.example.Person.PhoneNumber getPhone(int index) { | |
if (phoneBuilder_ == null) { | |
return phone_.get(index); | |
} else { | |
return phoneBuilder_.getMessage(index); | |
} | |
} | |
/** | |
* <code>repeated .publicobject.example.Person.PhoneNumber phone = 4;</code> | |
* | |
* <pre> | |
* A list of the user's phone numbers. | |
* </pre> | |
*/ | |
public Builder setPhone( | |
int index, com.publicobject.example.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; | |
} | |
/** | |
* <code>repeated .publicobject.example.Person.PhoneNumber phone = 4;</code> | |
* | |
* <pre> | |
* A list of the user's phone numbers. | |
* </pre> | |
*/ | |
public Builder setPhone( | |
int index, com.publicobject.example.Person.PhoneNumber.Builder builderForValue) { | |
if (phoneBuilder_ == null) { | |
ensurePhoneIsMutable(); | |
phone_.set(index, builderForValue.build()); | |
onChanged(); | |
} else { | |
phoneBuilder_.setMessage(index, builderForValue.build()); | |
} | |
return this; | |
} | |
/** | |
* <code>repeated .publicobject.example.Person.PhoneNumber phone = 4;</code> | |
* | |
* <pre> | |
* A list of the user's phone numbers. | |
* </pre> | |
*/ | |
public Builder addPhone(com.publicobject.example.Person.PhoneNumber value) { | |
if (phoneBuilder_ == null) { | |
if (value == null) { | |
throw new NullPointerException(); | |
} | |
ensurePhoneIsMutable(); | |
phone_.add(value); | |
onChanged(); | |
} else { | |
phoneBuilder_.addMessage(value); | |
} | |
return this; | |
} | |
/** | |
* <code>repeated .publicobject.example.Person.PhoneNumber phone = 4;</code> | |
* | |
* <pre> | |
* A list of the user's phone numbers. | |
* </pre> | |
*/ | |
public Builder addPhone( | |
int index, com.publicobject.example.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; | |
} | |
/** | |
* <code>repeated .publicobject.example.Person.PhoneNumber phone = 4;</code> | |
* | |
* <pre> | |
* A list of the user's phone numbers. | |
* </pre> | |
*/ | |
public Builder addPhone( | |
com.publicobject.example.Person.PhoneNumber.Builder builderForValue) { | |
if (phoneBuilder_ == null) { | |
ensurePhoneIsMutable(); | |
phone_.add(builderForValue.build()); | |
onChanged(); | |
} else { | |
phoneBuilder_.addMessage(builderForValue.build()); | |
} | |
return this; | |
} | |
/** | |
* <code>repeated .publicobject.example.Person.PhoneNumber phone = 4;</code> | |
* | |
* <pre> | |
* A list of the user's phone numbers. | |
* </pre> | |
*/ | |
public Builder addPhone( | |
int index, com.publicobject.example.Person.PhoneNumber.Builder builderForValue) { | |
if (phoneBuilder_ == null) { | |
ensurePhoneIsMutable(); | |
phone_.add(index, builderForValue.build()); | |
onChanged(); | |
} else { | |
phoneBuilder_.addMessage(index, builderForValue.build()); | |
} | |
return this; | |
} | |
/** | |
* <code>repeated .publicobject.example.Person.PhoneNumber phone = 4;</code> | |
* | |
* <pre> | |
* A list of the user's phone numbers. | |
* </pre> | |
*/ | |
public Builder addAllPhone( | |
java.lang.Iterable<? extends com.publicobject.example.Person.PhoneNumber> values) { | |
if (phoneBuilder_ == null) { | |
ensurePhoneIsMutable(); | |
com.google.protobuf.AbstractMessageLite.Builder.addAll( | |
values, phone_); | |
onChanged(); | |
} else { | |
phoneBuilder_.addAllMessages(values); | |
} | |
return this; | |
} | |
/** | |
* <code>repeated .publicobject.example.Person.PhoneNumber phone = 4;</code> | |
* | |
* <pre> | |
* A list of the user's phone numbers. | |
* </pre> | |
*/ | |
public Builder clearPhone() { | |
if (phoneBuilder_ == null) { | |
phone_ = java.util.Collections.emptyList(); | |
bitField0_ = (bitField0_ & ~0x00000008); | |
onChanged(); | |
} else { | |
phoneBuilder_.clear(); | |
} | |
return this; | |
} | |
/** | |
* <code>repeated .publicobject.example.Person.PhoneNumber phone = 4;</code> | |
* | |
* <pre> | |
* A list of the user's phone numbers. | |
* </pre> | |
*/ | |
public Builder removePhone(int index) { | |
if (phoneBuilder_ == null) { | |
ensurePhoneIsMutable(); | |
phone_.remove(index); | |
onChanged(); | |
} else { | |
phoneBuilder_.remove(index); | |
} | |
return this; | |
} | |
/** | |
* <code>repeated .publicobject.example.Person.PhoneNumber phone = 4;</code> | |
* | |
* <pre> | |
* A list of the user's phone numbers. | |
* </pre> | |
*/ | |
public com.publicobject.example.Person.PhoneNumber.Builder getPhoneBuilder( | |
int index) { | |
return getPhoneFieldBuilder().getBuilder(index); | |
} | |
/** | |
* <code>repeated .publicobject.example.Person.PhoneNumber phone = 4;</code> | |
* | |
* <pre> | |
* A list of the user's phone numbers. | |
* </pre> | |
*/ | |
public com.publicobject.example.Person.PhoneNumberOrBuilder getPhoneOrBuilder( | |
int index) { | |
if (phoneBuilder_ == null) { | |
return phone_.get(index); } else { | |
return phoneBuilder_.getMessageOrBuilder(index); | |
} | |
} | |
/** | |
* <code>repeated .publicobject.example.Person.PhoneNumber phone = 4;</code> | |
* | |
* <pre> | |
* A list of the user's phone numbers. | |
* </pre> | |
*/ | |
public java.util.List<? extends com.publicobject.example.Person.PhoneNumberOrBuilder> | |
getPhoneOrBuilderList() { | |
if (phoneBuilder_ != null) { | |
return phoneBuilder_.getMessageOrBuilderList(); | |
} else { | |
return java.util.Collections.unmodifiableList(phone_); | |
} | |
} | |
/** | |
* <code>repeated .publicobject.example.Person.PhoneNumber phone = 4;</code> | |
* | |
* <pre> | |
* A list of the user's phone numbers. | |
* </pre> | |
*/ | |
public com.publicobject.example.Person.PhoneNumber.Builder addPhoneBuilder() { | |
return getPhoneFieldBuilder().addBuilder( | |
com.publicobject.example.Person.PhoneNumber.getDefaultInstance()); | |
} | |
/** | |
* <code>repeated .publicobject.example.Person.PhoneNumber phone = 4;</code> | |
* | |
* <pre> | |
* A list of the user's phone numbers. | |
* </pre> | |
*/ | |
public com.publicobject.example.Person.PhoneNumber.Builder addPhoneBuilder( | |
int index) { | |
return getPhoneFieldBuilder().addBuilder( | |
index, com.publicobject.example.Person.PhoneNumber.getDefaultInstance()); | |
} | |
/** | |
* <code>repeated .publicobject.example.Person.PhoneNumber phone = 4;</code> | |
* | |
* <pre> | |
* A list of the user's phone numbers. | |
* </pre> | |
*/ | |
public java.util.List<com.publicobject.example.Person.PhoneNumber.Builder> | |
getPhoneBuilderList() { | |
return getPhoneFieldBuilder().getBuilderList(); | |
} | |
private com.google.protobuf.RepeatedFieldBuilder< | |
com.publicobject.example.Person.PhoneNumber, com.publicobject.example.Person.PhoneNumber.Builder, com.publicobject.example.Person.PhoneNumberOrBuilder> | |
getPhoneFieldBuilder() { | |
if (phoneBuilder_ == null) { | |
phoneBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< | |
com.publicobject.example.Person.PhoneNumber, com.publicobject.example.Person.PhoneNumber.Builder, com.publicobject.example.Person.PhoneNumberOrBuilder>( | |
phone_, | |
((bitField0_ & 0x00000008) == 0x00000008), | |
getParentForChildren(), | |
isClean()); | |
phone_ = null; | |
} | |
return phoneBuilder_; | |
} | |
private com.google.protobuf.MapField< | |
java.lang.String, java.lang.String> socialNetworkIdentities_ = | |
com.google.protobuf.MapField.newMapField( | |
socialNetworkIdentitiesDefaultEntry); | |
/** | |
* <code>map<string, string> social_network_identities = 5;</code> | |
*/ | |
public java.util.Map<java.lang.String, java.lang.String> getSocialNetworkIdentities() { | |
return socialNetworkIdentities_.getMap(); | |
} | |
/** | |
* <code>map<string, string> social_network_identities = 5;</code> | |
*/ | |
public java.util.Map<java.lang.String, java.lang.String> | |
getMutableSocialNetworkIdentities() { | |
onChanged(); | |
return socialNetworkIdentities_.getMutableMap(); | |
} | |
public final Builder setUnknownFields( | |
final com.google.protobuf.UnknownFieldSet unknownFields) { | |
return this; | |
} | |
public final Builder mergeUnknownFields( | |
final com.google.protobuf.UnknownFieldSet unknownFields) { | |
return this; | |
} | |
// @@protoc_insertion_point(builder_scope:publicobject.example.Person) | |
} | |
// @@protoc_insertion_point(class_scope:publicobject.example.Person) | |
private static final com.publicobject.example.Person defaultInstance;static { | |
defaultInstance = new com.publicobject.example.Person(); | |
} | |
public static com.publicobject.example.Person getDefaultInstance() { | |
return defaultInstance; | |
} | |
public com.publicobject.example.Person getDefaultInstanceForType() { | |
return defaultInstance; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I have a JSon object that I am getting from one of my web clients and I need to convert it into a protobuf and back to JSON - do you have a code example that might describe this?