Skip to content

Instantly share code, notes, and snippets.

@swankjesse
Created August 23, 2013 20:43
Show Gist options
  • Save swankjesse/6323811 to your computer and use it in GitHub Desktop.
Save swankjesse/6323811 to your computer and use it in GitHub Desktop.
Protocol Buffers from protoc 2.5.0.
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: person.proto
package com.squareup.wire.protos.person;
public final class PersonProtos {
private PersonProtos() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
}
public interface PersonOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// required string name = 1;
/**
* <code>required string name = 1;</code>
*
* <pre>
* The customer's full name.
* </pre>
*/
boolean hasName();
/**
* <code>required string name = 1;</code>
*
* <pre>
* The customer's full name.
* </pre>
*/
java.lang.String getName();
/**
* <code>required string name = 1;</code>
*
* <pre>
* The customer's full name.
* </pre>
*/
com.google.protobuf.ByteString
getNameBytes();
// required int32 id = 2;
/**
* <code>required int32 id = 2;</code>
*
* <pre>
* The customer's ID number.
* </pre>
*/
boolean hasId();
/**
* <code>required int32 id = 2;</code>
*
* <pre>
* The customer's ID number.
* </pre>
*/
int getId();
// optional string email = 3;
/**
* <code>optional string email = 3;</code>
*
* <pre>
* Email address for the customer.
* </pre>
*/
boolean hasEmail();
/**
* <code>optional string email = 3;</code>
*
* <pre>
* Email address for the customer.
* </pre>
*/
java.lang.String getEmail();
/**
* <code>optional string email = 3;</code>
*
* <pre>
* Email address for the customer.
* </pre>
*/
com.google.protobuf.ByteString
getEmailBytes();
// repeated .squareup.protos.person.Person.PhoneNumber phone = 4;
/**
* <code>repeated .squareup.protos.person.Person.PhoneNumber phone = 4;</code>
*
* <pre>
* A list of the user's phone numbers.
* </pre>
*/
java.util.List<com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber>
getPhoneList();
/**
* <code>repeated .squareup.protos.person.Person.PhoneNumber phone = 4;</code>
*
* <pre>
* A list of the user's phone numbers.
* </pre>
*/
com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber getPhone(int index);
/**
* <code>repeated .squareup.protos.person.Person.PhoneNumber phone = 4;</code>
*
* <pre>
* A list of the user's phone numbers.
* </pre>
*/
int getPhoneCount();
/**
* <code>repeated .squareup.protos.person.Person.PhoneNumber phone = 4;</code>
*
* <pre>
* A list of the user's phone numbers.
* </pre>
*/
java.util.List<? extends com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumberOrBuilder>
getPhoneOrBuilderList();
/**
* <code>repeated .squareup.protos.person.Person.PhoneNumber phone = 4;</code>
*
* <pre>
* A list of the user's phone numbers.
* </pre>
*/
com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumberOrBuilder getPhoneOrBuilder(
int index);
}
/**
* Protobuf type {@code squareup.protos.person.Person}
*/
public static final class Person extends
com.google.protobuf.GeneratedMessage
implements PersonOrBuilder {
// Use Person.newBuilder() to construct.
private Person(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private Person(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final Person defaultInstance;
public static Person getDefaultInstance() {
return defaultInstance;
}
public Person getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private Person(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
initFields();
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
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 34: {
if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
phone_ = new java.util.ArrayList<com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber>();
mutable_bitField0_ |= 0x00000008;
}
phone_.add(input.readMessage(com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber.PARSER, extensionRegistry));
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_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.squareup.wire.protos.person.PersonProtos.internal_static_squareup_protos_person_Person_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.squareup.wire.protos.person.PersonProtos.internal_static_squareup_protos_person_Person_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.squareup.wire.protos.person.PersonProtos.Person.class, com.squareup.wire.protos.person.PersonProtos.Person.Builder.class);
}
public static 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 squareup.protos.person.Person.PhoneType}
*/
public enum PhoneType
implements com.google.protobuf.ProtocolMessageEnum {
/**
* <code>MOBILE = 0;</code>
*/
MOBILE(0, 0),
/**
* <code>HOME = 1;</code>
*/
HOME(1, 1),
/**
* <code>WORK = 2;</code>
*/
WORK(2, 2),
;
/**
* <code>MOBILE = 0;</code>
*/
public static final int MOBILE_VALUE = 0;
/**
* <code>HOME = 1;</code>
*/
public static final int HOME_VALUE = 1;
/**
* <code>WORK = 2;</code>
*/
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<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.squareup.wire.protos.person.PersonProtos.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.");
}
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:squareup.protos.person.Person.PhoneType)
}
public interface PhoneNumberOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// required string number = 1;
/**
* <code>required string number = 1;</code>
*
* <pre>
* The user's phone number.
* </pre>
*/
boolean hasNumber();
/**
* <code>required string number = 1;</code>
*
* <pre>
* The user's phone number.
* </pre>
*/
java.lang.String getNumber();
/**
* <code>required string number = 1;</code>
*
* <pre>
* The user's phone number.
* </pre>
*/
com.google.protobuf.ByteString
getNumberBytes();
// optional .squareup.protos.person.Person.PhoneType type = 2 [default = HOME];
/**
* <code>optional .squareup.protos.person.Person.PhoneType type = 2 [default = HOME];</code>
*
* <pre>
* The type of phone stored here.
* </pre>
*/
boolean hasType();
/**
* <code>optional .squareup.protos.person.Person.PhoneType type = 2 [default = HOME];</code>
*
* <pre>
* The type of phone stored here.
* </pre>
*/
com.squareup.wire.protos.person.PersonProtos.Person.PhoneType getType();
}
/**
* Protobuf type {@code squareup.protos.person.Person.PhoneNumber}
*/
public static final class PhoneNumber extends
com.google.protobuf.GeneratedMessage
implements PhoneNumberOrBuilder {
// Use PhoneNumber.newBuilder() to construct.
private PhoneNumber(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private PhoneNumber(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final PhoneNumber defaultInstance;
public static PhoneNumber getDefaultInstance() {
return defaultInstance;
}
public PhoneNumber getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private PhoneNumber(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
initFields();
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 10: {
bitField0_ |= 0x00000001;
number_ = input.readBytes();
break;
}
case 16: {
int rawValue = input.readEnum();
com.squareup.wire.protos.person.PersonProtos.Person.PhoneType value = com.squareup.wire.protos.person.PersonProtos.Person.PhoneType.valueOf(rawValue);
if (value == null) {
unknownFields.mergeVarintField(2, rawValue);
} else {
bitField0_ |= 0x00000002;
type_ = value;
}
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 {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.squareup.wire.protos.person.PersonProtos.internal_static_squareup_protos_person_Person_PhoneNumber_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.squareup.wire.protos.person.PersonProtos.internal_static_squareup_protos_person_Person_PhoneNumber_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber.class, com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber.Builder.class);
}
public static 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;
}
private int bitField0_;
// required string number = 1;
public static final int NUMBER_FIELD_NUMBER = 1;
private java.lang.Object number_;
/**
* <code>required string number = 1;</code>
*
* <pre>
* The user's phone number.
* </pre>
*/
public boolean hasNumber() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required 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>required 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;
}
}
// optional .squareup.protos.person.Person.PhoneType type = 2 [default = HOME];
public static final int TYPE_FIELD_NUMBER = 2;
private com.squareup.wire.protos.person.PersonProtos.Person.PhoneType type_;
/**
* <code>optional .squareup.protos.person.Person.PhoneType type = 2 [default = HOME];</code>
*
* <pre>
* The type of phone stored here.
* </pre>
*/
public boolean hasType() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>optional .squareup.protos.person.Person.PhoneType type = 2 [default = HOME];</code>
*
* <pre>
* The type of phone stored here.
* </pre>
*/
public com.squareup.wire.protos.person.PersonProtos.Person.PhoneType getType() {
return type_;
}
private void initFields() {
number_ = "";
type_ = com.squareup.wire.protos.person.PersonProtos.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 com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.squareup.wire.protos.person.PersonProtos.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.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static com.squareup.wire.protos.person.PersonProtos.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 Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(com.squareup.wire.protos.person.PersonProtos.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 squareup.protos.person.Person.PhoneNumber}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumberOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.squareup.wire.protos.person.PersonProtos.internal_static_squareup_protos_person_Person_PhoneNumber_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.squareup.wire.protos.person.PersonProtos.internal_static_squareup_protos_person_Person_PhoneNumber_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber.class, com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber.Builder.class);
}
// Construct using com.squareup.wire.protos.person.PersonProtos.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) {
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
number_ = "";
bitField0_ = (bitField0_ & ~0x00000001);
type_ = com.squareup.wire.protos.person.PersonProtos.Person.PhoneType.HOME;
bitField0_ = (bitField0_ & ~0x00000002);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.squareup.wire.protos.person.PersonProtos.internal_static_squareup_protos_person_Person_PhoneNumber_descriptor;
}
public com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber getDefaultInstanceForType() {
return com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber.getDefaultInstance();
}
public com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber build() {
com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber buildPartial() {
com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber result = new com.squareup.wire.protos.person.PersonProtos.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 com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber) {
return mergeFrom((com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber other) {
if (other == com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber.getDefaultInstance()) return this;
if (other.hasNumber()) {
bitField0_ |= 0x00000001;
number_ = other.number_;
onChanged();
}
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.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
// required string number = 1;
private java.lang.Object number_ = "";
/**
* <code>required string number = 1;</code>
*
* <pre>
* The user's phone number.
* </pre>
*/
public boolean hasNumber() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required 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)) {
java.lang.String s = ((com.google.protobuf.ByteString) ref)
.toStringUtf8();
number_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>required 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>required string number = 1;</code>
*
* <pre>
* The user's phone number.
* </pre>
*/
public Builder setNumber(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
number_ = value;
onChanged();
return this;
}
/**
* <code>required string number = 1;</code>
*
* <pre>
* The user's phone number.
* </pre>
*/
public Builder clearNumber() {
bitField0_ = (bitField0_ & ~0x00000001);
number_ = getDefaultInstance().getNumber();
onChanged();
return this;
}
/**
* <code>required 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();
}
bitField0_ |= 0x00000001;
number_ = value;
onChanged();
return this;
}
// optional .squareup.protos.person.Person.PhoneType type = 2 [default = HOME];
private com.squareup.wire.protos.person.PersonProtos.Person.PhoneType type_ = com.squareup.wire.protos.person.PersonProtos.Person.PhoneType.HOME;
/**
* <code>optional .squareup.protos.person.Person.PhoneType type = 2 [default = HOME];</code>
*
* <pre>
* The type of phone stored here.
* </pre>
*/
public boolean hasType() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>optional .squareup.protos.person.Person.PhoneType type = 2 [default = HOME];</code>
*
* <pre>
* The type of phone stored here.
* </pre>
*/
public com.squareup.wire.protos.person.PersonProtos.Person.PhoneType getType() {
return type_;
}
/**
* <code>optional .squareup.protos.person.Person.PhoneType type = 2 [default = HOME];</code>
*
* <pre>
* The type of phone stored here.
* </pre>
*/
public Builder setType(com.squareup.wire.protos.person.PersonProtos.Person.PhoneType value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
type_ = value;
onChanged();
return this;
}
/**
* <code>optional .squareup.protos.person.Person.PhoneType type = 2 [default = HOME];</code>
*
* <pre>
* The type of phone stored here.
* </pre>
*/
public Builder clearType() {
bitField0_ = (bitField0_ & ~0x00000002);
type_ = com.squareup.wire.protos.person.PersonProtos.Person.PhoneType.HOME;
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:squareup.protos.person.Person.PhoneNumber)
}
static {
defaultInstance = new PhoneNumber(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:squareup.protos.person.Person.PhoneNumber)
}
private int bitField0_;
// required string name = 1;
public static final int NAME_FIELD_NUMBER = 1;
private java.lang.Object name_;
/**
* <code>required string name = 1;</code>
*
* <pre>
* The customer's full name.
* </pre>
*/
public boolean hasName() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required 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>required 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;
}
}
// required int32 id = 2;
public static final int ID_FIELD_NUMBER = 2;
private int id_;
/**
* <code>required int32 id = 2;</code>
*
* <pre>
* The customer's ID number.
* </pre>
*/
public boolean hasId() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>required int32 id = 2;</code>
*
* <pre>
* The customer's ID number.
* </pre>
*/
public int getId() {
return id_;
}
// optional string email = 3;
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 boolean hasEmail() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <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;
}
}
// repeated .squareup.protos.person.Person.PhoneNumber phone = 4;
public static final int PHONE_FIELD_NUMBER = 4;
private java.util.List<com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber> phone_;
/**
* <code>repeated .squareup.protos.person.Person.PhoneNumber phone = 4;</code>
*
* <pre>
* A list of the user's phone numbers.
* </pre>
*/
public java.util.List<com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber> getPhoneList() {
return phone_;
}
/**
* <code>repeated .squareup.protos.person.Person.PhoneNumber phone = 4;</code>
*
* <pre>
* A list of the user's phone numbers.
* </pre>
*/
public java.util.List<? extends com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumberOrBuilder>
getPhoneOrBuilderList() {
return phone_;
}
/**
* <code>repeated .squareup.protos.person.Person.PhoneNumber phone = 4;</code>
*
* <pre>
* A list of the user's phone numbers.
* </pre>
*/
public int getPhoneCount() {
return phone_.size();
}
/**
* <code>repeated .squareup.protos.person.Person.PhoneNumber phone = 4;</code>
*
* <pre>
* A list of the user's phone numbers.
* </pre>
*/
public com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber getPhone(int index) {
return phone_.get(index);
}
/**
* <code>repeated .squareup.protos.person.Person.PhoneNumber phone = 4;</code>
*
* <pre>
* A list of the user's phone numbers.
* </pre>
*/
public com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumberOrBuilder getPhoneOrBuilder(
int index) {
return phone_.get(index);
}
private void initFields() {
name_ = "";
id_ = 0;
email_ = "";
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());
}
for (int i = 0; i < phone_.size(); i++) {
output.writeMessage(4, 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());
}
for (int i = 0; i < phone_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(4, 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 com.squareup.wire.protos.person.PersonProtos.Person parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.squareup.wire.protos.person.PersonProtos.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.squareup.wire.protos.person.PersonProtos.Person parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.squareup.wire.protos.person.PersonProtos.Person parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.squareup.wire.protos.person.PersonProtos.Person parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static com.squareup.wire.protos.person.PersonProtos.Person parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static com.squareup.wire.protos.person.PersonProtos.Person parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static com.squareup.wire.protos.person.PersonProtos.Person parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static com.squareup.wire.protos.person.PersonProtos.Person parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static com.squareup.wire.protos.person.PersonProtos.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 Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(com.squareup.wire.protos.person.PersonProtos.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 squareup.protos.person.Person}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements com.squareup.wire.protos.person.PersonProtos.PersonOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.squareup.wire.protos.person.PersonProtos.internal_static_squareup_protos_person_Person_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.squareup.wire.protos.person.PersonProtos.internal_static_squareup_protos_person_Person_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.squareup.wire.protos.person.PersonProtos.Person.class, com.squareup.wire.protos.person.PersonProtos.Person.Builder.class);
}
// Construct using com.squareup.wire.protos.person.PersonProtos.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();
}
}
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);
if (phoneBuilder_ == null) {
phone_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000008);
} else {
phoneBuilder_.clear();
}
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.squareup.wire.protos.person.PersonProtos.internal_static_squareup_protos_person_Person_descriptor;
}
public com.squareup.wire.protos.person.PersonProtos.Person getDefaultInstanceForType() {
return com.squareup.wire.protos.person.PersonProtos.Person.getDefaultInstance();
}
public com.squareup.wire.protos.person.PersonProtos.Person build() {
com.squareup.wire.protos.person.PersonProtos.Person result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public com.squareup.wire.protos.person.PersonProtos.Person buildPartial() {
com.squareup.wire.protos.person.PersonProtos.Person result = new com.squareup.wire.protos.person.PersonProtos.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 (phoneBuilder_ == null) {
if (((bitField0_ & 0x00000008) == 0x00000008)) {
phone_ = java.util.Collections.unmodifiableList(phone_);
bitField0_ = (bitField0_ & ~0x00000008);
}
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 com.squareup.wire.protos.person.PersonProtos.Person) {
return mergeFrom((com.squareup.wire.protos.person.PersonProtos.Person)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.squareup.wire.protos.person.PersonProtos.Person other) {
if (other == com.squareup.wire.protos.person.PersonProtos.Person.getDefaultInstance()) return this;
if (other.hasName()) {
bitField0_ |= 0x00000001;
name_ = other.name_;
onChanged();
}
if (other.hasId()) {
setId(other.getId());
}
if (other.hasEmail()) {
bitField0_ |= 0x00000004;
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_);
}
}
}
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.squareup.wire.protos.person.PersonProtos.Person parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.squareup.wire.protos.person.PersonProtos.Person) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
// required string name = 1;
private java.lang.Object name_ = "";
/**
* <code>required string name = 1;</code>
*
* <pre>
* The customer's full name.
* </pre>
*/
public boolean hasName() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required 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)) {
java.lang.String s = ((com.google.protobuf.ByteString) ref)
.toStringUtf8();
name_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>required 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>required string name = 1;</code>
*
* <pre>
* The customer's full name.
* </pre>
*/
public Builder setName(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
name_ = value;
onChanged();
return this;
}
/**
* <code>required string name = 1;</code>
*
* <pre>
* The customer's full name.
* </pre>
*/
public Builder clearName() {
bitField0_ = (bitField0_ & ~0x00000001);
name_ = getDefaultInstance().getName();
onChanged();
return this;
}
/**
* <code>required 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();
}
bitField0_ |= 0x00000001;
name_ = value;
onChanged();
return this;
}
// required int32 id = 2;
private int id_ ;
/**
* <code>required int32 id = 2;</code>
*
* <pre>
* The customer's ID number.
* </pre>
*/
public boolean hasId() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>required int32 id = 2;</code>
*
* <pre>
* The customer's ID number.
* </pre>
*/
public int getId() {
return id_;
}
/**
* <code>required int32 id = 2;</code>
*
* <pre>
* The customer's ID number.
* </pre>
*/
public Builder setId(int value) {
bitField0_ |= 0x00000002;
id_ = value;
onChanged();
return this;
}
/**
* <code>required int32 id = 2;</code>
*
* <pre>
* The customer's ID number.
* </pre>
*/
public Builder clearId() {
bitField0_ = (bitField0_ & ~0x00000002);
id_ = 0;
onChanged();
return this;
}
// optional string email = 3;
private java.lang.Object email_ = "";
/**
* <code>optional string email = 3;</code>
*
* <pre>
* Email address for the customer.
* </pre>
*/
public boolean hasEmail() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <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)) {
java.lang.String s = ((com.google.protobuf.ByteString) ref)
.toStringUtf8();
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();
}
bitField0_ |= 0x00000004;
email_ = value;
onChanged();
return this;
}
/**
* <code>optional string email = 3;</code>
*
* <pre>
* Email address for the customer.
* </pre>
*/
public Builder clearEmail() {
bitField0_ = (bitField0_ & ~0x00000004);
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();
}
bitField0_ |= 0x00000004;
email_ = value;
onChanged();
return this;
}
// repeated .squareup.protos.person.Person.PhoneNumber phone = 4;
private java.util.List<com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber> phone_ =
java.util.Collections.emptyList();
private void ensurePhoneIsMutable() {
if (!((bitField0_ & 0x00000008) == 0x00000008)) {
phone_ = new java.util.ArrayList<com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber>(phone_);
bitField0_ |= 0x00000008;
}
}
private com.google.protobuf.RepeatedFieldBuilder<
com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber, com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber.Builder, com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumberOrBuilder> phoneBuilder_;
/**
* <code>repeated .squareup.protos.person.Person.PhoneNumber phone = 4;</code>
*
* <pre>
* A list of the user's phone numbers.
* </pre>
*/
public java.util.List<com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber> getPhoneList() {
if (phoneBuilder_ == null) {
return java.util.Collections.unmodifiableList(phone_);
} else {
return phoneBuilder_.getMessageList();
}
}
/**
* <code>repeated .squareup.protos.person.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 .squareup.protos.person.Person.PhoneNumber phone = 4;</code>
*
* <pre>
* A list of the user's phone numbers.
* </pre>
*/
public com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber getPhone(int index) {
if (phoneBuilder_ == null) {
return phone_.get(index);
} else {
return phoneBuilder_.getMessage(index);
}
}
/**
* <code>repeated .squareup.protos.person.Person.PhoneNumber phone = 4;</code>
*
* <pre>
* A list of the user's phone numbers.
* </pre>
*/
public Builder setPhone(
int index, com.squareup.wire.protos.person.PersonProtos.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 .squareup.protos.person.Person.PhoneNumber phone = 4;</code>
*
* <pre>
* A list of the user's phone numbers.
* </pre>
*/
public Builder setPhone(
int index, com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber.Builder builderForValue) {
if (phoneBuilder_ == null) {
ensurePhoneIsMutable();
phone_.set(index, builderForValue.build());
onChanged();
} else {
phoneBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .squareup.protos.person.Person.PhoneNumber phone = 4;</code>
*
* <pre>
* A list of the user's phone numbers.
* </pre>
*/
public Builder addPhone(com.squareup.wire.protos.person.PersonProtos.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 .squareup.protos.person.Person.PhoneNumber phone = 4;</code>
*
* <pre>
* A list of the user's phone numbers.
* </pre>
*/
public Builder addPhone(
int index, com.squareup.wire.protos.person.PersonProtos.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 .squareup.protos.person.Person.PhoneNumber phone = 4;</code>
*
* <pre>
* A list of the user's phone numbers.
* </pre>
*/
public Builder addPhone(
com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber.Builder builderForValue) {
if (phoneBuilder_ == null) {
ensurePhoneIsMutable();
phone_.add(builderForValue.build());
onChanged();
} else {
phoneBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* <code>repeated .squareup.protos.person.Person.PhoneNumber phone = 4;</code>
*
* <pre>
* A list of the user's phone numbers.
* </pre>
*/
public Builder addPhone(
int index, com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber.Builder builderForValue) {
if (phoneBuilder_ == null) {
ensurePhoneIsMutable();
phone_.add(index, builderForValue.build());
onChanged();
} else {
phoneBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .squareup.protos.person.Person.PhoneNumber phone = 4;</code>
*
* <pre>
* A list of the user's phone numbers.
* </pre>
*/
public Builder addAllPhone(
java.lang.Iterable<? extends com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber> values) {
if (phoneBuilder_ == null) {
ensurePhoneIsMutable();
super.addAll(values, phone_);
onChanged();
} else {
phoneBuilder_.addAllMessages(values);
}
return this;
}
/**
* <code>repeated .squareup.protos.person.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 .squareup.protos.person.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 .squareup.protos.person.Person.PhoneNumber phone = 4;</code>
*
* <pre>
* A list of the user's phone numbers.
* </pre>
*/
public com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber.Builder getPhoneBuilder(
int index) {
return getPhoneFieldBuilder().getBuilder(index);
}
/**
* <code>repeated .squareup.protos.person.Person.PhoneNumber phone = 4;</code>
*
* <pre>
* A list of the user's phone numbers.
* </pre>
*/
public com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumberOrBuilder getPhoneOrBuilder(
int index) {
if (phoneBuilder_ == null) {
return phone_.get(index); } else {
return phoneBuilder_.getMessageOrBuilder(index);
}
}
/**
* <code>repeated .squareup.protos.person.Person.PhoneNumber phone = 4;</code>
*
* <pre>
* A list of the user's phone numbers.
* </pre>
*/
public java.util.List<? extends com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumberOrBuilder>
getPhoneOrBuilderList() {
if (phoneBuilder_ != null) {
return phoneBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(phone_);
}
}
/**
* <code>repeated .squareup.protos.person.Person.PhoneNumber phone = 4;</code>
*
* <pre>
* A list of the user's phone numbers.
* </pre>
*/
public com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber.Builder addPhoneBuilder() {
return getPhoneFieldBuilder().addBuilder(
com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber.getDefaultInstance());
}
/**
* <code>repeated .squareup.protos.person.Person.PhoneNumber phone = 4;</code>
*
* <pre>
* A list of the user's phone numbers.
* </pre>
*/
public com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber.Builder addPhoneBuilder(
int index) {
return getPhoneFieldBuilder().addBuilder(
index, com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber.getDefaultInstance());
}
/**
* <code>repeated .squareup.protos.person.Person.PhoneNumber phone = 4;</code>
*
* <pre>
* A list of the user's phone numbers.
* </pre>
*/
public java.util.List<com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber.Builder>
getPhoneBuilderList() {
return getPhoneFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilder<
com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber, com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber.Builder, com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumberOrBuilder>
getPhoneFieldBuilder() {
if (phoneBuilder_ == null) {
phoneBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber, com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumber.Builder, com.squareup.wire.protos.person.PersonProtos.Person.PhoneNumberOrBuilder>(
phone_,
((bitField0_ & 0x00000008) == 0x00000008),
getParentForChildren(),
isClean());
phone_ = null;
}
return phoneBuilder_;
}
// @@protoc_insertion_point(builder_scope:squareup.protos.person.Person)
}
static {
defaultInstance = new Person(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:squareup.protos.person.Person)
}
private static com.google.protobuf.Descriptors.Descriptor
internal_static_squareup_protos_person_Person_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_squareup_protos_person_Person_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_squareup_protos_person_Person_PhoneNumber_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_squareup_protos_person_Person_PhoneNumber_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\014person.proto\022\026squareup.protos.person\"\366" +
"\001\n\006Person\022\014\n\004name\030\001 \002(\t\022\n\n\002id\030\002 \002(\005\022\r\n\005e" +
"mail\030\003 \001(\t\0229\n\005phone\030\004 \003(\0132*.squareup.pro" +
"tos.person.Person.PhoneNumber\032[\n\013PhoneNu" +
"mber\022\016\n\006number\030\001 \002(\t\022<\n\004type\030\002 \001(\0162(.squ" +
"areup.protos.person.Person.PhoneType:\004HO" +
"ME\"+\n\tPhoneType\022\n\n\006MOBILE\020\000\022\010\n\004HOME\020\001\022\010\n" +
"\004WORK\020\002B/\n\037com.squareup.wire.protos.pers" +
"onB\014PersonProtos"
};
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_squareup_protos_person_Person_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_squareup_protos_person_Person_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_squareup_protos_person_Person_descriptor,
new java.lang.String[] { "Name", "Id", "Email", "Phone", });
internal_static_squareup_protos_person_Person_PhoneNumber_descriptor =
internal_static_squareup_protos_person_Person_descriptor.getNestedTypes().get(0);
internal_static_squareup_protos_person_Person_PhoneNumber_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_squareup_protos_person_Person_PhoneNumber_descriptor,
new java.lang.String[] { "Number", "Type", });
return null;
}
};
com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
}, assigner);
}
// @@protoc_insertion_point(outer_class_scope)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment