All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.os72.protobuf351.Option Maven / Gradle / Ivy

There is a newer version: 1.0.43
Show newest version
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/protobuf/type.proto

package com.github.os72.protobuf351;

/**
 * 
 * A protocol buffer option, which can be attached to a message, field,
 * enumeration, etc.
 * 
* * Protobuf type {@code google.protobuf.Option} */ public final class Option extends com.github.os72.protobuf351.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.protobuf.Option) OptionOrBuilder { private static final long serialVersionUID = 0L; // Use Option.newBuilder() to construct. private Option(com.github.os72.protobuf351.GeneratedMessageV3.Builder builder) { super(builder); } private Option() { name_ = ""; } @java.lang.Override public final com.github.os72.protobuf351.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private Option( com.github.os72.protobuf351.CodedInputStream input, com.github.os72.protobuf351.ExtensionRegistryLite extensionRegistry) throws com.github.os72.protobuf351.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } int mutable_bitField0_ = 0; com.github.os72.protobuf351.UnknownFieldSet.Builder unknownFields = com.github.os72.protobuf351.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; default: { if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } case 10: { java.lang.String s = input.readStringRequireUtf8(); name_ = s; break; } case 18: { com.github.os72.protobuf351.Any.Builder subBuilder = null; if (value_ != null) { subBuilder = value_.toBuilder(); } value_ = input.readMessage(com.github.os72.protobuf351.Any.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(value_); value_ = subBuilder.buildPartial(); } break; } } } } catch (com.github.os72.protobuf351.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.github.os72.protobuf351.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.github.os72.protobuf351.Descriptors.Descriptor getDescriptor() { return com.github.os72.protobuf351.TypeProto.internal_static_google_protobuf_Option_descriptor; } protected com.github.os72.protobuf351.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.github.os72.protobuf351.TypeProto.internal_static_google_protobuf_Option_fieldAccessorTable .ensureFieldAccessorsInitialized( com.github.os72.protobuf351.Option.class, com.github.os72.protobuf351.Option.Builder.class); } public static final int NAME_FIELD_NUMBER = 1; private volatile java.lang.Object name_; /** *
   * The option's name. For protobuf built-in options (options defined in
   * descriptor.proto), this is the short name. For example, `"map_entry"`.
   * For custom options, it should be the fully-qualified name. For example,
   * `"google.api.http"`.
   * 
* * string name = 1; */ public java.lang.String getName() { java.lang.Object ref = name_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.github.os72.protobuf351.ByteString bs = (com.github.os72.protobuf351.ByteString) ref; java.lang.String s = bs.toStringUtf8(); name_ = s; return s; } } /** *
   * The option's name. For protobuf built-in options (options defined in
   * descriptor.proto), this is the short name. For example, `"map_entry"`.
   * For custom options, it should be the fully-qualified name. For example,
   * `"google.api.http"`.
   * 
* * string name = 1; */ public com.github.os72.protobuf351.ByteString getNameBytes() { java.lang.Object ref = name_; if (ref instanceof java.lang.String) { com.github.os72.protobuf351.ByteString b = com.github.os72.protobuf351.ByteString.copyFromUtf8( (java.lang.String) ref); name_ = b; return b; } else { return (com.github.os72.protobuf351.ByteString) ref; } } public static final int VALUE_FIELD_NUMBER = 2; private com.github.os72.protobuf351.Any value_; /** *
   * The option's value packed in an Any message. If the value is a primitive,
   * the corresponding wrapper type defined in google/protobuf/wrappers.proto
   * should be used. If the value is an enum, it should be stored as an int32
   * value using the google.protobuf.Int32Value type.
   * 
* * .google.protobuf.Any value = 2; */ public boolean hasValue() { return value_ != null; } /** *
   * The option's value packed in an Any message. If the value is a primitive,
   * the corresponding wrapper type defined in google/protobuf/wrappers.proto
   * should be used. If the value is an enum, it should be stored as an int32
   * value using the google.protobuf.Int32Value type.
   * 
* * .google.protobuf.Any value = 2; */ public com.github.os72.protobuf351.Any getValue() { return value_ == null ? com.github.os72.protobuf351.Any.getDefaultInstance() : value_; } /** *
   * The option's value packed in an Any message. If the value is a primitive,
   * the corresponding wrapper type defined in google/protobuf/wrappers.proto
   * should be used. If the value is an enum, it should be stored as an int32
   * value using the google.protobuf.Int32Value type.
   * 
* * .google.protobuf.Any value = 2; */ public com.github.os72.protobuf351.AnyOrBuilder getValueOrBuilder() { return getValue(); } 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.github.os72.protobuf351.CodedOutputStream output) throws java.io.IOException { if (!getNameBytes().isEmpty()) { com.github.os72.protobuf351.GeneratedMessageV3.writeString(output, 1, name_); } if (value_ != null) { output.writeMessage(2, getValue()); } unknownFields.writeTo(output); } public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getNameBytes().isEmpty()) { size += com.github.os72.protobuf351.GeneratedMessageV3.computeStringSize(1, name_); } if (value_ != null) { size += com.github.os72.protobuf351.CodedOutputStream .computeMessageSize(2, getValue()); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.github.os72.protobuf351.Option)) { return super.equals(obj); } com.github.os72.protobuf351.Option other = (com.github.os72.protobuf351.Option) obj; boolean result = true; result = result && getName() .equals(other.getName()); result = result && (hasValue() == other.hasValue()); if (hasValue()) { result = result && getValue() .equals(other.getValue()); } result = result && unknownFields.equals(other.unknownFields); return result; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); if (hasValue()) { hash = (37 * hash) + VALUE_FIELD_NUMBER; hash = (53 * hash) + getValue().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.github.os72.protobuf351.Option parseFrom( java.nio.ByteBuffer data) throws com.github.os72.protobuf351.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.github.os72.protobuf351.Option parseFrom( java.nio.ByteBuffer data, com.github.os72.protobuf351.ExtensionRegistryLite extensionRegistry) throws com.github.os72.protobuf351.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.github.os72.protobuf351.Option parseFrom( com.github.os72.protobuf351.ByteString data) throws com.github.os72.protobuf351.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.github.os72.protobuf351.Option parseFrom( com.github.os72.protobuf351.ByteString data, com.github.os72.protobuf351.ExtensionRegistryLite extensionRegistry) throws com.github.os72.protobuf351.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.github.os72.protobuf351.Option parseFrom(byte[] data) throws com.github.os72.protobuf351.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.github.os72.protobuf351.Option parseFrom( byte[] data, com.github.os72.protobuf351.ExtensionRegistryLite extensionRegistry) throws com.github.os72.protobuf351.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.github.os72.protobuf351.Option parseFrom(java.io.InputStream input) throws java.io.IOException { return com.github.os72.protobuf351.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.github.os72.protobuf351.Option parseFrom( java.io.InputStream input, com.github.os72.protobuf351.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.github.os72.protobuf351.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static com.github.os72.protobuf351.Option parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.github.os72.protobuf351.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static com.github.os72.protobuf351.Option parseDelimitedFrom( java.io.InputStream input, com.github.os72.protobuf351.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.github.os72.protobuf351.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static com.github.os72.protobuf351.Option parseFrom( com.github.os72.protobuf351.CodedInputStream input) throws java.io.IOException { return com.github.os72.protobuf351.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.github.os72.protobuf351.Option parseFrom( com.github.os72.protobuf351.CodedInputStream input, com.github.os72.protobuf351.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.github.os72.protobuf351.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.github.os72.protobuf351.Option prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType( com.github.os72.protobuf351.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** *
   * A protocol buffer option, which can be attached to a message, field,
   * enumeration, etc.
   * 
* * Protobuf type {@code google.protobuf.Option} */ public static final class Builder extends com.github.os72.protobuf351.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:google.protobuf.Option) com.github.os72.protobuf351.OptionOrBuilder { public static final com.github.os72.protobuf351.Descriptors.Descriptor getDescriptor() { return com.github.os72.protobuf351.TypeProto.internal_static_google_protobuf_Option_descriptor; } protected com.github.os72.protobuf351.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.github.os72.protobuf351.TypeProto.internal_static_google_protobuf_Option_fieldAccessorTable .ensureFieldAccessorsInitialized( com.github.os72.protobuf351.Option.class, com.github.os72.protobuf351.Option.Builder.class); } // Construct using com.github.os72.protobuf351.Option.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.github.os72.protobuf351.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.github.os72.protobuf351.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } public Builder clear() { super.clear(); name_ = ""; if (valueBuilder_ == null) { value_ = null; } else { value_ = null; valueBuilder_ = null; } return this; } public com.github.os72.protobuf351.Descriptors.Descriptor getDescriptorForType() { return com.github.os72.protobuf351.TypeProto.internal_static_google_protobuf_Option_descriptor; } public com.github.os72.protobuf351.Option getDefaultInstanceForType() { return com.github.os72.protobuf351.Option.getDefaultInstance(); } public com.github.os72.protobuf351.Option build() { com.github.os72.protobuf351.Option result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } public com.github.os72.protobuf351.Option buildPartial() { com.github.os72.protobuf351.Option result = new com.github.os72.protobuf351.Option(this); result.name_ = name_; if (valueBuilder_ == null) { result.value_ = value_; } else { result.value_ = valueBuilder_.build(); } onBuilt(); return result; } public Builder clone() { return (Builder) super.clone(); } public Builder setField( com.github.os72.protobuf351.Descriptors.FieldDescriptor field, java.lang.Object value) { return (Builder) super.setField(field, value); } public Builder clearField( com.github.os72.protobuf351.Descriptors.FieldDescriptor field) { return (Builder) super.clearField(field); } public Builder clearOneof( com.github.os72.protobuf351.Descriptors.OneofDescriptor oneof) { return (Builder) super.clearOneof(oneof); } public Builder setRepeatedField( com.github.os72.protobuf351.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return (Builder) super.setRepeatedField(field, index, value); } public Builder addRepeatedField( com.github.os72.protobuf351.Descriptors.FieldDescriptor field, java.lang.Object value) { return (Builder) super.addRepeatedField(field, value); } public Builder mergeFrom(com.github.os72.protobuf351.Message other) { if (other instanceof com.github.os72.protobuf351.Option) { return mergeFrom((com.github.os72.protobuf351.Option)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.github.os72.protobuf351.Option other) { if (other == com.github.os72.protobuf351.Option.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } if (other.hasValue()) { mergeValue(other.getValue()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } public final boolean isInitialized() { return true; } public Builder mergeFrom( com.github.os72.protobuf351.CodedInputStream input, com.github.os72.protobuf351.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.github.os72.protobuf351.Option parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.github.os72.protobuf351.InvalidProtocolBufferException e) { parsedMessage = (com.github.os72.protobuf351.Option) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private java.lang.Object name_ = ""; /** *
     * The option's name. For protobuf built-in options (options defined in
     * descriptor.proto), this is the short name. For example, `"map_entry"`.
     * For custom options, it should be the fully-qualified name. For example,
     * `"google.api.http"`.
     * 
* * string name = 1; */ public java.lang.String getName() { java.lang.Object ref = name_; if (!(ref instanceof java.lang.String)) { com.github.os72.protobuf351.ByteString bs = (com.github.os72.protobuf351.ByteString) ref; java.lang.String s = bs.toStringUtf8(); name_ = s; return s; } else { return (java.lang.String) ref; } } /** *
     * The option's name. For protobuf built-in options (options defined in
     * descriptor.proto), this is the short name. For example, `"map_entry"`.
     * For custom options, it should be the fully-qualified name. For example,
     * `"google.api.http"`.
     * 
* * string name = 1; */ public com.github.os72.protobuf351.ByteString getNameBytes() { java.lang.Object ref = name_; if (ref instanceof String) { com.github.os72.protobuf351.ByteString b = com.github.os72.protobuf351.ByteString.copyFromUtf8( (java.lang.String) ref); name_ = b; return b; } else { return (com.github.os72.protobuf351.ByteString) ref; } } /** *
     * The option's name. For protobuf built-in options (options defined in
     * descriptor.proto), this is the short name. For example, `"map_entry"`.
     * For custom options, it should be the fully-qualified name. For example,
     * `"google.api.http"`.
     * 
* * string name = 1; */ public Builder setName( java.lang.String value) { if (value == null) { throw new NullPointerException(); } name_ = value; onChanged(); return this; } /** *
     * The option's name. For protobuf built-in options (options defined in
     * descriptor.proto), this is the short name. For example, `"map_entry"`.
     * For custom options, it should be the fully-qualified name. For example,
     * `"google.api.http"`.
     * 
* * string name = 1; */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } /** *
     * The option's name. For protobuf built-in options (options defined in
     * descriptor.proto), this is the short name. For example, `"map_entry"`.
     * For custom options, it should be the fully-qualified name. For example,
     * `"google.api.http"`.
     * 
* * string name = 1; */ public Builder setNameBytes( com.github.os72.protobuf351.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); name_ = value; onChanged(); return this; } private com.github.os72.protobuf351.Any value_ = null; private com.github.os72.protobuf351.SingleFieldBuilderV3< com.github.os72.protobuf351.Any, com.github.os72.protobuf351.Any.Builder, com.github.os72.protobuf351.AnyOrBuilder> valueBuilder_; /** *
     * The option's value packed in an Any message. If the value is a primitive,
     * the corresponding wrapper type defined in google/protobuf/wrappers.proto
     * should be used. If the value is an enum, it should be stored as an int32
     * value using the google.protobuf.Int32Value type.
     * 
* * .google.protobuf.Any value = 2; */ public boolean hasValue() { return valueBuilder_ != null || value_ != null; } /** *
     * The option's value packed in an Any message. If the value is a primitive,
     * the corresponding wrapper type defined in google/protobuf/wrappers.proto
     * should be used. If the value is an enum, it should be stored as an int32
     * value using the google.protobuf.Int32Value type.
     * 
* * .google.protobuf.Any value = 2; */ public com.github.os72.protobuf351.Any getValue() { if (valueBuilder_ == null) { return value_ == null ? com.github.os72.protobuf351.Any.getDefaultInstance() : value_; } else { return valueBuilder_.getMessage(); } } /** *
     * The option's value packed in an Any message. If the value is a primitive,
     * the corresponding wrapper type defined in google/protobuf/wrappers.proto
     * should be used. If the value is an enum, it should be stored as an int32
     * value using the google.protobuf.Int32Value type.
     * 
* * .google.protobuf.Any value = 2; */ public Builder setValue(com.github.os72.protobuf351.Any value) { if (valueBuilder_ == null) { if (value == null) { throw new NullPointerException(); } value_ = value; onChanged(); } else { valueBuilder_.setMessage(value); } return this; } /** *
     * The option's value packed in an Any message. If the value is a primitive,
     * the corresponding wrapper type defined in google/protobuf/wrappers.proto
     * should be used. If the value is an enum, it should be stored as an int32
     * value using the google.protobuf.Int32Value type.
     * 
* * .google.protobuf.Any value = 2; */ public Builder setValue( com.github.os72.protobuf351.Any.Builder builderForValue) { if (valueBuilder_ == null) { value_ = builderForValue.build(); onChanged(); } else { valueBuilder_.setMessage(builderForValue.build()); } return this; } /** *
     * The option's value packed in an Any message. If the value is a primitive,
     * the corresponding wrapper type defined in google/protobuf/wrappers.proto
     * should be used. If the value is an enum, it should be stored as an int32
     * value using the google.protobuf.Int32Value type.
     * 
* * .google.protobuf.Any value = 2; */ public Builder mergeValue(com.github.os72.protobuf351.Any value) { if (valueBuilder_ == null) { if (value_ != null) { value_ = com.github.os72.protobuf351.Any.newBuilder(value_).mergeFrom(value).buildPartial(); } else { value_ = value; } onChanged(); } else { valueBuilder_.mergeFrom(value); } return this; } /** *
     * The option's value packed in an Any message. If the value is a primitive,
     * the corresponding wrapper type defined in google/protobuf/wrappers.proto
     * should be used. If the value is an enum, it should be stored as an int32
     * value using the google.protobuf.Int32Value type.
     * 
* * .google.protobuf.Any value = 2; */ public Builder clearValue() { if (valueBuilder_ == null) { value_ = null; onChanged(); } else { value_ = null; valueBuilder_ = null; } return this; } /** *
     * The option's value packed in an Any message. If the value is a primitive,
     * the corresponding wrapper type defined in google/protobuf/wrappers.proto
     * should be used. If the value is an enum, it should be stored as an int32
     * value using the google.protobuf.Int32Value type.
     * 
* * .google.protobuf.Any value = 2; */ public com.github.os72.protobuf351.Any.Builder getValueBuilder() { onChanged(); return getValueFieldBuilder().getBuilder(); } /** *
     * The option's value packed in an Any message. If the value is a primitive,
     * the corresponding wrapper type defined in google/protobuf/wrappers.proto
     * should be used. If the value is an enum, it should be stored as an int32
     * value using the google.protobuf.Int32Value type.
     * 
* * .google.protobuf.Any value = 2; */ public com.github.os72.protobuf351.AnyOrBuilder getValueOrBuilder() { if (valueBuilder_ != null) { return valueBuilder_.getMessageOrBuilder(); } else { return value_ == null ? com.github.os72.protobuf351.Any.getDefaultInstance() : value_; } } /** *
     * The option's value packed in an Any message. If the value is a primitive,
     * the corresponding wrapper type defined in google/protobuf/wrappers.proto
     * should be used. If the value is an enum, it should be stored as an int32
     * value using the google.protobuf.Int32Value type.
     * 
* * .google.protobuf.Any value = 2; */ private com.github.os72.protobuf351.SingleFieldBuilderV3< com.github.os72.protobuf351.Any, com.github.os72.protobuf351.Any.Builder, com.github.os72.protobuf351.AnyOrBuilder> getValueFieldBuilder() { if (valueBuilder_ == null) { valueBuilder_ = new com.github.os72.protobuf351.SingleFieldBuilderV3< com.github.os72.protobuf351.Any, com.github.os72.protobuf351.Any.Builder, com.github.os72.protobuf351.AnyOrBuilder>( getValue(), getParentForChildren(), isClean()); value_ = null; } return valueBuilder_; } public final Builder setUnknownFields( final com.github.os72.protobuf351.UnknownFieldSet unknownFields) { return super.setUnknownFieldsProto3(unknownFields); } public final Builder mergeUnknownFields( final com.github.os72.protobuf351.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:google.protobuf.Option) } // @@protoc_insertion_point(class_scope:google.protobuf.Option) private static final com.github.os72.protobuf351.Option DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.github.os72.protobuf351.Option(); } public static com.github.os72.protobuf351.Option getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.github.os72.protobuf351.Parser




© 2015 - 2024 Weber Informatics LLC | Privacy Policy