/java/src/com/google/publicalerts/cap/ValuePair.java
https://code.google.com/p/cap-library/ · Java · 520 lines · 468 code · 43 blank · 9 comment · 72 complexity · d5ee56c8965dc03e27392e565b07a6c2 MD5 · raw file
- // Generated by the protocol buffer compiler. DO NOT EDIT!
- package com.google.publicalerts.cap;
- public final class ValuePair extends
- com.google.protobuf.GeneratedMessage
- implements ValuePairOrBuilder {
- // Use ValuePair.newBuilder() to construct.
- private ValuePair(Builder builder) {
- super(builder);
- }
- private ValuePair(boolean noInit) {}
-
- private static final ValuePair defaultInstance;
- public static ValuePair getDefaultInstance() {
- return defaultInstance;
- }
-
- public ValuePair getDefaultInstanceForType() {
- return defaultInstance;
- }
-
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return com.google.publicalerts.cap.Cap.internal_static_publicalerts_cap_ValuePair_descriptor;
- }
-
- protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return com.google.publicalerts.cap.Cap.internal_static_publicalerts_cap_ValuePair_fieldAccessorTable;
- }
-
- private int bitField0_;
- // required string value_name = 1;
- public static final int VALUE_NAME_FIELD_NUMBER = 1;
- private java.lang.Object valueName_;
- public boolean hasValueName() {
- return ((bitField0_ & 0x00000001) == 0x00000001);
- }
- public String getValueName() {
- java.lang.Object ref = valueName_;
- if (ref instanceof String) {
- return (String) ref;
- } else {
- com.google.protobuf.ByteString bs =
- (com.google.protobuf.ByteString) ref;
- String s = bs.toStringUtf8();
- if (com.google.protobuf.Internal.isValidUtf8(bs)) {
- valueName_ = s;
- }
- return s;
- }
- }
- private com.google.protobuf.ByteString getValueNameBytes() {
- java.lang.Object ref = valueName_;
- if (ref instanceof String) {
- com.google.protobuf.ByteString b =
- com.google.protobuf.ByteString.copyFromUtf8((String) ref);
- valueName_ = b;
- return b;
- } else {
- return (com.google.protobuf.ByteString) ref;
- }
- }
-
- // required string value = 2;
- public static final int VALUE_FIELD_NUMBER = 2;
- private java.lang.Object value_;
- public boolean hasValue() {
- return ((bitField0_ & 0x00000002) == 0x00000002);
- }
- public String getValue() {
- java.lang.Object ref = value_;
- if (ref instanceof String) {
- return (String) ref;
- } else {
- com.google.protobuf.ByteString bs =
- (com.google.protobuf.ByteString) ref;
- String s = bs.toStringUtf8();
- if (com.google.protobuf.Internal.isValidUtf8(bs)) {
- value_ = s;
- }
- return s;
- }
- }
- private com.google.protobuf.ByteString getValueBytes() {
- java.lang.Object ref = value_;
- if (ref instanceof String) {
- com.google.protobuf.ByteString b =
- com.google.protobuf.ByteString.copyFromUtf8((String) ref);
- value_ = b;
- return b;
- } else {
- return (com.google.protobuf.ByteString) ref;
- }
- }
-
- private void initFields() {
- valueName_ = "";
- value_ = "";
- }
- private byte memoizedIsInitialized = -1;
- public final boolean isInitialized() {
- byte isInitialized = memoizedIsInitialized;
- if (isInitialized != -1) return isInitialized == 1;
-
- if (!hasValueName()) {
- memoizedIsInitialized = 0;
- return false;
- }
- if (!hasValue()) {
- 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, getValueNameBytes());
- }
- if (((bitField0_ & 0x00000002) == 0x00000002)) {
- output.writeBytes(2, getValueBytes());
- }
- 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, getValueNameBytes());
- }
- if (((bitField0_ & 0x00000002) == 0x00000002)) {
- size += com.google.protobuf.CodedOutputStream
- .computeBytesSize(2, getValueBytes());
- }
- 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();
- }
-
- @java.lang.Override
- public boolean equals(final java.lang.Object obj) {
- if (obj == this) {
- return true;
- }
- if (!(obj instanceof com.google.publicalerts.cap.ValuePair)) {
- return super.equals(obj);
- }
- com.google.publicalerts.cap.ValuePair other = (com.google.publicalerts.cap.ValuePair) obj;
-
- boolean result = true;
- result = result && (hasValueName() == other.hasValueName());
- if (hasValueName()) {
- result = result && getValueName()
- .equals(other.getValueName());
- }
- result = result && (hasValue() == other.hasValue());
- if (hasValue()) {
- result = result && getValue()
- .equals(other.getValue());
- }
- result = result &&
- getUnknownFields().equals(other.getUnknownFields());
- return result;
- }
-
- @java.lang.Override
- public int hashCode() {
- int hash = 41;
- hash = (19 * hash) + getDescriptorForType().hashCode();
- if (hasValueName()) {
- hash = (37 * hash) + VALUE_NAME_FIELD_NUMBER;
- hash = (53 * hash) + getValueName().hashCode();
- }
- if (hasValue()) {
- hash = (37 * hash) + VALUE_FIELD_NUMBER;
- hash = (53 * hash) + getValue().hashCode();
- }
- hash = (29 * hash) + getUnknownFields().hashCode();
- return hash;
- }
-
- public static com.google.publicalerts.cap.ValuePair parseFrom(
- com.google.protobuf.ByteString data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return newBuilder().mergeFrom(data).buildParsed();
- }
- public static com.google.publicalerts.cap.ValuePair parseFrom(
- com.google.protobuf.ByteString data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return newBuilder().mergeFrom(data, extensionRegistry)
- .buildParsed();
- }
- public static com.google.publicalerts.cap.ValuePair parseFrom(byte[] data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return newBuilder().mergeFrom(data).buildParsed();
- }
- public static com.google.publicalerts.cap.ValuePair parseFrom(
- byte[] data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return newBuilder().mergeFrom(data, extensionRegistry)
- .buildParsed();
- }
- public static com.google.publicalerts.cap.ValuePair parseFrom(java.io.InputStream input)
- throws java.io.IOException {
- return newBuilder().mergeFrom(input).buildParsed();
- }
- public static com.google.publicalerts.cap.ValuePair parseFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return newBuilder().mergeFrom(input, extensionRegistry)
- .buildParsed();
- }
- public static com.google.publicalerts.cap.ValuePair parseDelimitedFrom(java.io.InputStream input)
- throws java.io.IOException {
- Builder builder = newBuilder();
- if (builder.mergeDelimitedFrom(input)) {
- return builder.buildParsed();
- } else {
- return null;
- }
- }
- public static com.google.publicalerts.cap.ValuePair parseDelimitedFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- Builder builder = newBuilder();
- if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
- return builder.buildParsed();
- } else {
- return null;
- }
- }
- public static com.google.publicalerts.cap.ValuePair parseFrom(
- com.google.protobuf.CodedInputStream input)
- throws java.io.IOException {
- return newBuilder().mergeFrom(input).buildParsed();
- }
- public static com.google.publicalerts.cap.ValuePair parseFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return newBuilder().mergeFrom(input, extensionRegistry)
- .buildParsed();
- }
-
- public static Builder newBuilder() { return Builder.create(); }
- public Builder newBuilderForType() { return newBuilder(); }
- public static Builder newBuilder(com.google.publicalerts.cap.ValuePair prototype) {
- return newBuilder().mergeFrom(prototype);
- }
- public Builder toBuilder() { return newBuilder(this); }
-
- @java.lang.Override
- protected Builder newBuilderForType(
- com.google.protobuf.GeneratedMessage.BuilderParent parent) {
- Builder builder = new Builder(parent);
- return builder;
- }
- public static final class Builder extends
- com.google.protobuf.GeneratedMessage.Builder<Builder>
- implements com.google.publicalerts.cap.ValuePairOrBuilder {
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return com.google.publicalerts.cap.Cap.internal_static_publicalerts_cap_ValuePair_descriptor;
- }
-
- protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return com.google.publicalerts.cap.Cap.internal_static_publicalerts_cap_ValuePair_fieldAccessorTable;
- }
-
- // Construct using com.google.publicalerts.cap.ValuePair.newBuilder()
- private Builder() {
- maybeForceBuilderInitialization();
- }
-
- private Builder(BuilderParent parent) {
- super(parent);
- maybeForceBuilderInitialization();
- }
- private void maybeForceBuilderInitialization() {
- if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
- }
- }
- private static Builder create() {
- return new Builder();
- }
-
- public Builder clear() {
- super.clear();
- valueName_ = "";
- bitField0_ = (bitField0_ & ~0x00000001);
- value_ = "";
- bitField0_ = (bitField0_ & ~0x00000002);
- return this;
- }
-
- public Builder clone() {
- return create().mergeFrom(buildPartial());
- }
-
- public com.google.protobuf.Descriptors.Descriptor
- getDescriptorForType() {
- return com.google.publicalerts.cap.ValuePair.getDescriptor();
- }
-
- public com.google.publicalerts.cap.ValuePair getDefaultInstanceForType() {
- return com.google.publicalerts.cap.ValuePair.getDefaultInstance();
- }
-
- public com.google.publicalerts.cap.ValuePair build() {
- com.google.publicalerts.cap.ValuePair result = buildPartial();
- if (!result.isInitialized()) {
- throw newUninitializedMessageException(result);
- }
- return result;
- }
-
- private com.google.publicalerts.cap.ValuePair buildParsed()
- throws com.google.protobuf.InvalidProtocolBufferException {
- com.google.publicalerts.cap.ValuePair result = buildPartial();
- if (!result.isInitialized()) {
- throw newUninitializedMessageException(
- result).asInvalidProtocolBufferException();
- }
- return result;
- }
-
- public com.google.publicalerts.cap.ValuePair buildPartial() {
- com.google.publicalerts.cap.ValuePair result = new com.google.publicalerts.cap.ValuePair(this);
- int from_bitField0_ = bitField0_;
- int to_bitField0_ = 0;
- if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
- to_bitField0_ |= 0x00000001;
- }
- result.valueName_ = valueName_;
- if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
- to_bitField0_ |= 0x00000002;
- }
- result.value_ = value_;
- result.bitField0_ = to_bitField0_;
- onBuilt();
- return result;
- }
-
- public Builder mergeFrom(com.google.protobuf.Message other) {
- if (other instanceof com.google.publicalerts.cap.ValuePair) {
- return mergeFrom((com.google.publicalerts.cap.ValuePair)other);
- } else {
- super.mergeFrom(other);
- return this;
- }
- }
-
- public Builder mergeFrom(com.google.publicalerts.cap.ValuePair other) {
- if (other == com.google.publicalerts.cap.ValuePair.getDefaultInstance()) return this;
- if (other.hasValueName()) {
- setValueName(other.getValueName());
- }
- if (other.hasValue()) {
- setValue(other.getValue());
- }
- this.mergeUnknownFields(other.getUnknownFields());
- return this;
- }
-
- public final boolean isInitialized() {
- if (!hasValueName()) {
-
- return false;
- }
- if (!hasValue()) {
-
- return false;
- }
- return true;
- }
-
- public Builder mergeFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- com.google.protobuf.UnknownFieldSet.Builder unknownFields =
- com.google.protobuf.UnknownFieldSet.newBuilder(
- this.getUnknownFields());
- while (true) {
- int tag = input.readTag();
- switch (tag) {
- case 0:
- this.setUnknownFields(unknownFields.build());
- onChanged();
- return this;
- default: {
- if (!parseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- this.setUnknownFields(unknownFields.build());
- onChanged();
- return this;
- }
- break;
- }
- case 10: {
- bitField0_ |= 0x00000001;
- valueName_ = input.readBytes();
- break;
- }
- case 18: {
- bitField0_ |= 0x00000002;
- value_ = input.readBytes();
- break;
- }
- }
- }
- }
-
- private int bitField0_;
-
- // required string value_name = 1;
- private java.lang.Object valueName_ = "";
- public boolean hasValueName() {
- return ((bitField0_ & 0x00000001) == 0x00000001);
- }
- public String getValueName() {
- java.lang.Object ref = valueName_;
- if (!(ref instanceof String)) {
- String s = ((com.google.protobuf.ByteString) ref).toStringUtf8();
- valueName_ = s;
- return s;
- } else {
- return (String) ref;
- }
- }
- public Builder setValueName(String value) {
- if (value == null) {
- throw new NullPointerException();
- }
- bitField0_ |= 0x00000001;
- valueName_ = value;
- onChanged();
- return this;
- }
- public Builder clearValueName() {
- bitField0_ = (bitField0_ & ~0x00000001);
- valueName_ = getDefaultInstance().getValueName();
- onChanged();
- return this;
- }
- void setValueName(com.google.protobuf.ByteString value) {
- bitField0_ |= 0x00000001;
- valueName_ = value;
- onChanged();
- }
-
- // required string value = 2;
- private java.lang.Object value_ = "";
- public boolean hasValue() {
- return ((bitField0_ & 0x00000002) == 0x00000002);
- }
- public String getValue() {
- java.lang.Object ref = value_;
- if (!(ref instanceof String)) {
- String s = ((com.google.protobuf.ByteString) ref).toStringUtf8();
- value_ = s;
- return s;
- } else {
- return (String) ref;
- }
- }
- public Builder setValue(String value) {
- if (value == null) {
- throw new NullPointerException();
- }
- bitField0_ |= 0x00000002;
- value_ = value;
- onChanged();
- return this;
- }
- public Builder clearValue() {
- bitField0_ = (bitField0_ & ~0x00000002);
- value_ = getDefaultInstance().getValue();
- onChanged();
- return this;
- }
- void setValue(com.google.protobuf.ByteString value) {
- bitField0_ |= 0x00000002;
- value_ = value;
- onChanged();
- }
-
- // @@protoc_insertion_point(builder_scope:publicalerts.cap.ValuePair)
- }
-
- static {
- defaultInstance = new ValuePair(true);
- defaultInstance.initFields();
- }
-
- // @@protoc_insertion_point(class_scope:publicalerts.cap.ValuePair)
- }