com.google.protobuf.Api Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of protobuf-lite Show documentation
Show all versions of protobuf-lite Show documentation
A trimmed-down version of the Protocol Buffers library.
The newest version!
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/api.proto
package com.google.protobuf;
/**
*
* Api is a light-weight descriptor for a protocol buffer service.
*
*
* Protobuf type {@code google.protobuf.Api}
*/
public final class Api extends
com.google.protobuf.GeneratedMessageLite<
Api, Api.Builder> implements
// @@protoc_insertion_point(message_implements:google.protobuf.Api)
ApiOrBuilder {
private Api() {
name_ = "";
methods_ = emptyProtobufList();
options_ = emptyProtobufList();
version_ = "";
mixins_ = emptyProtobufList();
}
private int bitField0_;
public static final int NAME_FIELD_NUMBER = 1;
private java.lang.String name_;
/**
*
* The fully qualified name of this api, including package name
* followed by the api's simple name.
*
*
* optional string name = 1;
*/
public java.lang.String getName() {
return name_;
}
/**
*
* The fully qualified name of this api, including package name
* followed by the api's simple name.
*
*
* optional string name = 1;
*/
public com.google.protobuf.ByteString
getNameBytes() {
return com.google.protobuf.ByteString.copyFromUtf8(name_);
}
/**
*
* The fully qualified name of this api, including package name
* followed by the api's simple name.
*
*
* optional string name = 1;
*/
private void setName(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
name_ = value;
}
/**
*
* The fully qualified name of this api, including package name
* followed by the api's simple name.
*
*
* optional string name = 1;
*/
private void clearName() {
name_ = getDefaultInstance().getName();
}
/**
*
* The fully qualified name of this api, including package name
* followed by the api's simple name.
*
*
* optional string name = 1;
*/
private void setNameBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
name_ = value.toStringUtf8();
}
public static final int METHODS_FIELD_NUMBER = 2;
private com.google.protobuf.Internal.ProtobufList methods_;
/**
*
* The methods of this api, in unspecified order.
*
*
* repeated .google.protobuf.Method methods = 2;
*/
public java.util.List getMethodsList() {
return methods_;
}
/**
*
* The methods of this api, in unspecified order.
*
*
* repeated .google.protobuf.Method methods = 2;
*/
public java.util.List extends com.google.protobuf.MethodOrBuilder>
getMethodsOrBuilderList() {
return methods_;
}
/**
*
* The methods of this api, in unspecified order.
*
*
* repeated .google.protobuf.Method methods = 2;
*/
public int getMethodsCount() {
return methods_.size();
}
/**
*
* The methods of this api, in unspecified order.
*
*
* repeated .google.protobuf.Method methods = 2;
*/
public com.google.protobuf.Method getMethods(int index) {
return methods_.get(index);
}
/**
*
* The methods of this api, in unspecified order.
*
*
* repeated .google.protobuf.Method methods = 2;
*/
public com.google.protobuf.MethodOrBuilder getMethodsOrBuilder(
int index) {
return methods_.get(index);
}
private void ensureMethodsIsMutable() {
if (!methods_.isModifiable()) {
methods_ =
com.google.protobuf.GeneratedMessageLite.mutableCopy(methods_);
}
}
/**
*
* The methods of this api, in unspecified order.
*
*
* repeated .google.protobuf.Method methods = 2;
*/
private void setMethods(
int index, com.google.protobuf.Method value) {
if (value == null) {
throw new NullPointerException();
}
ensureMethodsIsMutable();
methods_.set(index, value);
}
/**
*
* The methods of this api, in unspecified order.
*
*
* repeated .google.protobuf.Method methods = 2;
*/
private void setMethods(
int index, com.google.protobuf.Method.Builder builderForValue) {
ensureMethodsIsMutable();
methods_.set(index, builderForValue.build());
}
/**
*
* The methods of this api, in unspecified order.
*
*
* repeated .google.protobuf.Method methods = 2;
*/
private void addMethods(com.google.protobuf.Method value) {
if (value == null) {
throw new NullPointerException();
}
ensureMethodsIsMutable();
methods_.add(value);
}
/**
*
* The methods of this api, in unspecified order.
*
*
* repeated .google.protobuf.Method methods = 2;
*/
private void addMethods(
int index, com.google.protobuf.Method value) {
if (value == null) {
throw new NullPointerException();
}
ensureMethodsIsMutable();
methods_.add(index, value);
}
/**
*
* The methods of this api, in unspecified order.
*
*
* repeated .google.protobuf.Method methods = 2;
*/
private void addMethods(
com.google.protobuf.Method.Builder builderForValue) {
ensureMethodsIsMutable();
methods_.add(builderForValue.build());
}
/**
*
* The methods of this api, in unspecified order.
*
*
* repeated .google.protobuf.Method methods = 2;
*/
private void addMethods(
int index, com.google.protobuf.Method.Builder builderForValue) {
ensureMethodsIsMutable();
methods_.add(index, builderForValue.build());
}
/**
*
* The methods of this api, in unspecified order.
*
*
* repeated .google.protobuf.Method methods = 2;
*/
private void addAllMethods(
java.lang.Iterable extends com.google.protobuf.Method> values) {
ensureMethodsIsMutable();
com.google.protobuf.AbstractMessageLite.addAll(
values, methods_);
}
/**
*
* The methods of this api, in unspecified order.
*
*
* repeated .google.protobuf.Method methods = 2;
*/
private void clearMethods() {
methods_ = emptyProtobufList();
}
/**
*
* The methods of this api, in unspecified order.
*
*
* repeated .google.protobuf.Method methods = 2;
*/
private void removeMethods(int index) {
ensureMethodsIsMutable();
methods_.remove(index);
}
public static final int OPTIONS_FIELD_NUMBER = 3;
private com.google.protobuf.Internal.ProtobufList options_;
/**
*
* Any metadata attached to the API.
*
*
* repeated .google.protobuf.Option options = 3;
*/
public java.util.List getOptionsList() {
return options_;
}
/**
*
* Any metadata attached to the API.
*
*
* repeated .google.protobuf.Option options = 3;
*/
public java.util.List extends com.google.protobuf.OptionOrBuilder>
getOptionsOrBuilderList() {
return options_;
}
/**
*
* Any metadata attached to the API.
*
*
* repeated .google.protobuf.Option options = 3;
*/
public int getOptionsCount() {
return options_.size();
}
/**
*
* Any metadata attached to the API.
*
*
* repeated .google.protobuf.Option options = 3;
*/
public com.google.protobuf.Option getOptions(int index) {
return options_.get(index);
}
/**
*
* Any metadata attached to the API.
*
*
* repeated .google.protobuf.Option options = 3;
*/
public com.google.protobuf.OptionOrBuilder getOptionsOrBuilder(
int index) {
return options_.get(index);
}
private void ensureOptionsIsMutable() {
if (!options_.isModifiable()) {
options_ =
com.google.protobuf.GeneratedMessageLite.mutableCopy(options_);
}
}
/**
*
* Any metadata attached to the API.
*
*
* repeated .google.protobuf.Option options = 3;
*/
private void setOptions(
int index, com.google.protobuf.Option value) {
if (value == null) {
throw new NullPointerException();
}
ensureOptionsIsMutable();
options_.set(index, value);
}
/**
*
* Any metadata attached to the API.
*
*
* repeated .google.protobuf.Option options = 3;
*/
private void setOptions(
int index, com.google.protobuf.Option.Builder builderForValue) {
ensureOptionsIsMutable();
options_.set(index, builderForValue.build());
}
/**
*
* Any metadata attached to the API.
*
*
* repeated .google.protobuf.Option options = 3;
*/
private void addOptions(com.google.protobuf.Option value) {
if (value == null) {
throw new NullPointerException();
}
ensureOptionsIsMutable();
options_.add(value);
}
/**
*
* Any metadata attached to the API.
*
*
* repeated .google.protobuf.Option options = 3;
*/
private void addOptions(
int index, com.google.protobuf.Option value) {
if (value == null) {
throw new NullPointerException();
}
ensureOptionsIsMutable();
options_.add(index, value);
}
/**
*
* Any metadata attached to the API.
*
*
* repeated .google.protobuf.Option options = 3;
*/
private void addOptions(
com.google.protobuf.Option.Builder builderForValue) {
ensureOptionsIsMutable();
options_.add(builderForValue.build());
}
/**
*
* Any metadata attached to the API.
*
*
* repeated .google.protobuf.Option options = 3;
*/
private void addOptions(
int index, com.google.protobuf.Option.Builder builderForValue) {
ensureOptionsIsMutable();
options_.add(index, builderForValue.build());
}
/**
*
* Any metadata attached to the API.
*
*
* repeated .google.protobuf.Option options = 3;
*/
private void addAllOptions(
java.lang.Iterable extends com.google.protobuf.Option> values) {
ensureOptionsIsMutable();
com.google.protobuf.AbstractMessageLite.addAll(
values, options_);
}
/**
*
* Any metadata attached to the API.
*
*
* repeated .google.protobuf.Option options = 3;
*/
private void clearOptions() {
options_ = emptyProtobufList();
}
/**
*
* Any metadata attached to the API.
*
*
* repeated .google.protobuf.Option options = 3;
*/
private void removeOptions(int index) {
ensureOptionsIsMutable();
options_.remove(index);
}
public static final int VERSION_FIELD_NUMBER = 4;
private java.lang.String version_;
/**
*
* A version string for this api. If specified, must have the form
* `major-version.minor-version`, as in `1.10`. If the minor version
* is omitted, it defaults to zero. If the entire version field is
* empty, the major version is derived from the package name, as
* outlined below. If the field is not empty, the version in the
* package name will be verified to be consistent with what is
* provided here.
* The versioning schema uses [semantic
* versioning](http://semver.org) where the major version number
* indicates a breaking change and the minor version an additive,
* non-breaking change. Both version numbers are signals to users
* what to expect from different versions, and should be carefully
* chosen based on the product plan.
* The major version is also reflected in the package name of the
* API, which must end in `v<major-version>`, as in
* `google.feature.v1`. For major versions 0 and 1, the suffix can
* be omitted. Zero major versions must only be used for
* experimental, none-GA apis.
*
*
* optional string version = 4;
*/
public java.lang.String getVersion() {
return version_;
}
/**
*
* A version string for this api. If specified, must have the form
* `major-version.minor-version`, as in `1.10`. If the minor version
* is omitted, it defaults to zero. If the entire version field is
* empty, the major version is derived from the package name, as
* outlined below. If the field is not empty, the version in the
* package name will be verified to be consistent with what is
* provided here.
* The versioning schema uses [semantic
* versioning](http://semver.org) where the major version number
* indicates a breaking change and the minor version an additive,
* non-breaking change. Both version numbers are signals to users
* what to expect from different versions, and should be carefully
* chosen based on the product plan.
* The major version is also reflected in the package name of the
* API, which must end in `v<major-version>`, as in
* `google.feature.v1`. For major versions 0 and 1, the suffix can
* be omitted. Zero major versions must only be used for
* experimental, none-GA apis.
*
*
* optional string version = 4;
*/
public com.google.protobuf.ByteString
getVersionBytes() {
return com.google.protobuf.ByteString.copyFromUtf8(version_);
}
/**
*
* A version string for this api. If specified, must have the form
* `major-version.minor-version`, as in `1.10`. If the minor version
* is omitted, it defaults to zero. If the entire version field is
* empty, the major version is derived from the package name, as
* outlined below. If the field is not empty, the version in the
* package name will be verified to be consistent with what is
* provided here.
* The versioning schema uses [semantic
* versioning](http://semver.org) where the major version number
* indicates a breaking change and the minor version an additive,
* non-breaking change. Both version numbers are signals to users
* what to expect from different versions, and should be carefully
* chosen based on the product plan.
* The major version is also reflected in the package name of the
* API, which must end in `v<major-version>`, as in
* `google.feature.v1`. For major versions 0 and 1, the suffix can
* be omitted. Zero major versions must only be used for
* experimental, none-GA apis.
*
*
* optional string version = 4;
*/
private void setVersion(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
version_ = value;
}
/**
*
* A version string for this api. If specified, must have the form
* `major-version.minor-version`, as in `1.10`. If the minor version
* is omitted, it defaults to zero. If the entire version field is
* empty, the major version is derived from the package name, as
* outlined below. If the field is not empty, the version in the
* package name will be verified to be consistent with what is
* provided here.
* The versioning schema uses [semantic
* versioning](http://semver.org) where the major version number
* indicates a breaking change and the minor version an additive,
* non-breaking change. Both version numbers are signals to users
* what to expect from different versions, and should be carefully
* chosen based on the product plan.
* The major version is also reflected in the package name of the
* API, which must end in `v<major-version>`, as in
* `google.feature.v1`. For major versions 0 and 1, the suffix can
* be omitted. Zero major versions must only be used for
* experimental, none-GA apis.
*
*
* optional string version = 4;
*/
private void clearVersion() {
version_ = getDefaultInstance().getVersion();
}
/**
*
* A version string for this api. If specified, must have the form
* `major-version.minor-version`, as in `1.10`. If the minor version
* is omitted, it defaults to zero. If the entire version field is
* empty, the major version is derived from the package name, as
* outlined below. If the field is not empty, the version in the
* package name will be verified to be consistent with what is
* provided here.
* The versioning schema uses [semantic
* versioning](http://semver.org) where the major version number
* indicates a breaking change and the minor version an additive,
* non-breaking change. Both version numbers are signals to users
* what to expect from different versions, and should be carefully
* chosen based on the product plan.
* The major version is also reflected in the package name of the
* API, which must end in `v<major-version>`, as in
* `google.feature.v1`. For major versions 0 and 1, the suffix can
* be omitted. Zero major versions must only be used for
* experimental, none-GA apis.
*
*
* optional string version = 4;
*/
private void setVersionBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
version_ = value.toStringUtf8();
}
public static final int SOURCE_CONTEXT_FIELD_NUMBER = 5;
private com.google.protobuf.SourceContext sourceContext_;
/**
*
* Source context for the protocol buffer service represented by this
* message.
*
*
* optional .google.protobuf.SourceContext source_context = 5;
*/
public boolean hasSourceContext() {
return sourceContext_ != null;
}
/**
*
* Source context for the protocol buffer service represented by this
* message.
*
*
* optional .google.protobuf.SourceContext source_context = 5;
*/
public com.google.protobuf.SourceContext getSourceContext() {
return sourceContext_ == null ? com.google.protobuf.SourceContext.getDefaultInstance() : sourceContext_;
}
/**
*
* Source context for the protocol buffer service represented by this
* message.
*
*
* optional .google.protobuf.SourceContext source_context = 5;
*/
private void setSourceContext(com.google.protobuf.SourceContext value) {
if (value == null) {
throw new NullPointerException();
}
sourceContext_ = value;
}
/**
*
* Source context for the protocol buffer service represented by this
* message.
*
*
* optional .google.protobuf.SourceContext source_context = 5;
*/
private void setSourceContext(
com.google.protobuf.SourceContext.Builder builderForValue) {
sourceContext_ = builderForValue.build();
}
/**
*
* Source context for the protocol buffer service represented by this
* message.
*
*
* optional .google.protobuf.SourceContext source_context = 5;
*/
private void mergeSourceContext(com.google.protobuf.SourceContext value) {
if (sourceContext_ != null &&
sourceContext_ != com.google.protobuf.SourceContext.getDefaultInstance()) {
sourceContext_ =
com.google.protobuf.SourceContext.newBuilder(sourceContext_).mergeFrom(value).buildPartial();
} else {
sourceContext_ = value;
}
}
/**
*
* Source context for the protocol buffer service represented by this
* message.
*
*
* optional .google.protobuf.SourceContext source_context = 5;
*/
private void clearSourceContext() { sourceContext_ = null;
}
public static final int MIXINS_FIELD_NUMBER = 6;
private com.google.protobuf.Internal.ProtobufList mixins_;
/**
*
* Included APIs. See [Mixin][].
*
*
* repeated .google.protobuf.Mixin mixins = 6;
*/
public java.util.List getMixinsList() {
return mixins_;
}
/**
*
* Included APIs. See [Mixin][].
*
*
* repeated .google.protobuf.Mixin mixins = 6;
*/
public java.util.List extends com.google.protobuf.MixinOrBuilder>
getMixinsOrBuilderList() {
return mixins_;
}
/**
*
* Included APIs. See [Mixin][].
*
*
* repeated .google.protobuf.Mixin mixins = 6;
*/
public int getMixinsCount() {
return mixins_.size();
}
/**
*
* Included APIs. See [Mixin][].
*
*
* repeated .google.protobuf.Mixin mixins = 6;
*/
public com.google.protobuf.Mixin getMixins(int index) {
return mixins_.get(index);
}
/**
*
* Included APIs. See [Mixin][].
*
*
* repeated .google.protobuf.Mixin mixins = 6;
*/
public com.google.protobuf.MixinOrBuilder getMixinsOrBuilder(
int index) {
return mixins_.get(index);
}
private void ensureMixinsIsMutable() {
if (!mixins_.isModifiable()) {
mixins_ =
com.google.protobuf.GeneratedMessageLite.mutableCopy(mixins_);
}
}
/**
*
* Included APIs. See [Mixin][].
*
*
* repeated .google.protobuf.Mixin mixins = 6;
*/
private void setMixins(
int index, com.google.protobuf.Mixin value) {
if (value == null) {
throw new NullPointerException();
}
ensureMixinsIsMutable();
mixins_.set(index, value);
}
/**
*
* Included APIs. See [Mixin][].
*
*
* repeated .google.protobuf.Mixin mixins = 6;
*/
private void setMixins(
int index, com.google.protobuf.Mixin.Builder builderForValue) {
ensureMixinsIsMutable();
mixins_.set(index, builderForValue.build());
}
/**
*
* Included APIs. See [Mixin][].
*
*
* repeated .google.protobuf.Mixin mixins = 6;
*/
private void addMixins(com.google.protobuf.Mixin value) {
if (value == null) {
throw new NullPointerException();
}
ensureMixinsIsMutable();
mixins_.add(value);
}
/**
*
* Included APIs. See [Mixin][].
*
*
* repeated .google.protobuf.Mixin mixins = 6;
*/
private void addMixins(
int index, com.google.protobuf.Mixin value) {
if (value == null) {
throw new NullPointerException();
}
ensureMixinsIsMutable();
mixins_.add(index, value);
}
/**
*
* Included APIs. See [Mixin][].
*
*
* repeated .google.protobuf.Mixin mixins = 6;
*/
private void addMixins(
com.google.protobuf.Mixin.Builder builderForValue) {
ensureMixinsIsMutable();
mixins_.add(builderForValue.build());
}
/**
*
* Included APIs. See [Mixin][].
*
*
* repeated .google.protobuf.Mixin mixins = 6;
*/
private void addMixins(
int index, com.google.protobuf.Mixin.Builder builderForValue) {
ensureMixinsIsMutable();
mixins_.add(index, builderForValue.build());
}
/**
*
* Included APIs. See [Mixin][].
*
*
* repeated .google.protobuf.Mixin mixins = 6;
*/
private void addAllMixins(
java.lang.Iterable extends com.google.protobuf.Mixin> values) {
ensureMixinsIsMutable();
com.google.protobuf.AbstractMessageLite.addAll(
values, mixins_);
}
/**
*
* Included APIs. See [Mixin][].
*
*
* repeated .google.protobuf.Mixin mixins = 6;
*/
private void clearMixins() {
mixins_ = emptyProtobufList();
}
/**
*
* Included APIs. See [Mixin][].
*
*
* repeated .google.protobuf.Mixin mixins = 6;
*/
private void removeMixins(int index) {
ensureMixinsIsMutable();
mixins_.remove(index);
}
public static final int SYNTAX_FIELD_NUMBER = 7;
private int syntax_;
/**
*
* The source syntax of the service.
*
*
* optional .google.protobuf.Syntax syntax = 7;
*/
public int getSyntaxValue() {
return syntax_;
}
/**
*
* The source syntax of the service.
*
*
* optional .google.protobuf.Syntax syntax = 7;
*/
public com.google.protobuf.Syntax getSyntax() {
com.google.protobuf.Syntax result = com.google.protobuf.Syntax.forNumber(syntax_);
return result == null ? com.google.protobuf.Syntax.UNRECOGNIZED : result;
}
/**
*
* The source syntax of the service.
*
*
* optional .google.protobuf.Syntax syntax = 7;
*/
private void setSyntaxValue(int value) {
syntax_ = value;
}
/**
*
* The source syntax of the service.
*
*
* optional .google.protobuf.Syntax syntax = 7;
*/
private void setSyntax(com.google.protobuf.Syntax value) {
if (value == null) {
throw new NullPointerException();
}
syntax_ = value.getNumber();
}
/**
*
* The source syntax of the service.
*
*
* optional .google.protobuf.Syntax syntax = 7;
*/
private void clearSyntax() {
syntax_ = 0;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!name_.isEmpty()) {
output.writeString(1, getName());
}
for (int i = 0; i < methods_.size(); i++) {
output.writeMessage(2, methods_.get(i));
}
for (int i = 0; i < options_.size(); i++) {
output.writeMessage(3, options_.get(i));
}
if (!version_.isEmpty()) {
output.writeString(4, getVersion());
}
if (sourceContext_ != null) {
output.writeMessage(5, getSourceContext());
}
for (int i = 0; i < mixins_.size(); i++) {
output.writeMessage(6, mixins_.get(i));
}
if (syntax_ != com.google.protobuf.Syntax.SYNTAX_PROTO2.getNumber()) {
output.writeEnum(7, syntax_);
}
}
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (!name_.isEmpty()) {
size += com.google.protobuf.CodedOutputStream
.computeStringSize(1, getName());
}
for (int i = 0; i < methods_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, methods_.get(i));
}
for (int i = 0; i < options_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(3, options_.get(i));
}
if (!version_.isEmpty()) {
size += com.google.protobuf.CodedOutputStream
.computeStringSize(4, getVersion());
}
if (sourceContext_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(5, getSourceContext());
}
for (int i = 0; i < mixins_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(6, mixins_.get(i));
}
if (syntax_ != com.google.protobuf.Syntax.SYNTAX_PROTO2.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(7, syntax_);
}
memoizedSerializedSize = size;
return size;
}
public static com.google.protobuf.Api parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, data);
}
public static com.google.protobuf.Api parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, data, extensionRegistry);
}
public static com.google.protobuf.Api parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, data);
}
public static com.google.protobuf.Api parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, data, extensionRegistry);
}
public static com.google.protobuf.Api parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, input);
}
public static com.google.protobuf.Api parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, input, extensionRegistry);
}
public static com.google.protobuf.Api parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return parseDelimitedFrom(DEFAULT_INSTANCE, input);
}
public static com.google.protobuf.Api parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry);
}
public static com.google.protobuf.Api parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, input);
}
public static com.google.protobuf.Api parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, input, extensionRegistry);
}
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.google.protobuf.Api prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
/**
*
* Api is a light-weight descriptor for a protocol buffer service.
*
*
* Protobuf type {@code google.protobuf.Api}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageLite.Builder<
com.google.protobuf.Api, Builder> implements
// @@protoc_insertion_point(builder_implements:google.protobuf.Api)
com.google.protobuf.ApiOrBuilder {
// Construct using com.google.protobuf.Api.newBuilder()
private Builder() {
super(DEFAULT_INSTANCE);
}
/**
*
* The fully qualified name of this api, including package name
* followed by the api's simple name.
*
*
* optional string name = 1;
*/
public java.lang.String getName() {
return instance.getName();
}
/**
*
* The fully qualified name of this api, including package name
* followed by the api's simple name.
*
*
* optional string name = 1;
*/
public com.google.protobuf.ByteString
getNameBytes() {
return instance.getNameBytes();
}
/**
*
* The fully qualified name of this api, including package name
* followed by the api's simple name.
*
*
* optional string name = 1;
*/
public Builder setName(
java.lang.String value) {
copyOnWrite();
instance.setName(value);
return this;
}
/**
*
* The fully qualified name of this api, including package name
* followed by the api's simple name.
*
*
* optional string name = 1;
*/
public Builder clearName() {
copyOnWrite();
instance.clearName();
return this;
}
/**
*
* The fully qualified name of this api, including package name
* followed by the api's simple name.
*
*
* optional string name = 1;
*/
public Builder setNameBytes(
com.google.protobuf.ByteString value) {
copyOnWrite();
instance.setNameBytes(value);
return this;
}
/**
*
* The methods of this api, in unspecified order.
*
*
* repeated .google.protobuf.Method methods = 2;
*/
public java.util.List getMethodsList() {
return java.util.Collections.unmodifiableList(
instance.getMethodsList());
}
/**
*
* The methods of this api, in unspecified order.
*
*
* repeated .google.protobuf.Method methods = 2;
*/
public int getMethodsCount() {
return instance.getMethodsCount();
}/**
*
* The methods of this api, in unspecified order.
*
*
* repeated .google.protobuf.Method methods = 2;
*/
public com.google.protobuf.Method getMethods(int index) {
return instance.getMethods(index);
}
/**
*
* The methods of this api, in unspecified order.
*
*
* repeated .google.protobuf.Method methods = 2;
*/
public Builder setMethods(
int index, com.google.protobuf.Method value) {
copyOnWrite();
instance.setMethods(index, value);
return this;
}
/**
*
* The methods of this api, in unspecified order.
*
*
* repeated .google.protobuf.Method methods = 2;
*/
public Builder setMethods(
int index, com.google.protobuf.Method.Builder builderForValue) {
copyOnWrite();
instance.setMethods(index, builderForValue);
return this;
}
/**
*
* The methods of this api, in unspecified order.
*
*
* repeated .google.protobuf.Method methods = 2;
*/
public Builder addMethods(com.google.protobuf.Method value) {
copyOnWrite();
instance.addMethods(value);
return this;
}
/**
*
* The methods of this api, in unspecified order.
*
*
* repeated .google.protobuf.Method methods = 2;
*/
public Builder addMethods(
int index, com.google.protobuf.Method value) {
copyOnWrite();
instance.addMethods(index, value);
return this;
}
/**
*
* The methods of this api, in unspecified order.
*
*
* repeated .google.protobuf.Method methods = 2;
*/
public Builder addMethods(
com.google.protobuf.Method.Builder builderForValue) {
copyOnWrite();
instance.addMethods(builderForValue);
return this;
}
/**
*
* The methods of this api, in unspecified order.
*
*
* repeated .google.protobuf.Method methods = 2;
*/
public Builder addMethods(
int index, com.google.protobuf.Method.Builder builderForValue) {
copyOnWrite();
instance.addMethods(index, builderForValue);
return this;
}
/**
*
* The methods of this api, in unspecified order.
*
*
* repeated .google.protobuf.Method methods = 2;
*/
public Builder addAllMethods(
java.lang.Iterable extends com.google.protobuf.Method> values) {
copyOnWrite();
instance.addAllMethods(values);
return this;
}
/**
*
* The methods of this api, in unspecified order.
*
*
* repeated .google.protobuf.Method methods = 2;
*/
public Builder clearMethods() {
copyOnWrite();
instance.clearMethods();
return this;
}
/**
*
* The methods of this api, in unspecified order.
*
*
* repeated .google.protobuf.Method methods = 2;
*/
public Builder removeMethods(int index) {
copyOnWrite();
instance.removeMethods(index);
return this;
}
/**
*
* Any metadata attached to the API.
*
*
* repeated .google.protobuf.Option options = 3;
*/
public java.util.List getOptionsList() {
return java.util.Collections.unmodifiableList(
instance.getOptionsList());
}
/**
*
* Any metadata attached to the API.
*
*
* repeated .google.protobuf.Option options = 3;
*/
public int getOptionsCount() {
return instance.getOptionsCount();
}/**
*
* Any metadata attached to the API.
*
*
* repeated .google.protobuf.Option options = 3;
*/
public com.google.protobuf.Option getOptions(int index) {
return instance.getOptions(index);
}
/**
*
* Any metadata attached to the API.
*
*
* repeated .google.protobuf.Option options = 3;
*/
public Builder setOptions(
int index, com.google.protobuf.Option value) {
copyOnWrite();
instance.setOptions(index, value);
return this;
}
/**
*
* Any metadata attached to the API.
*
*
* repeated .google.protobuf.Option options = 3;
*/
public Builder setOptions(
int index, com.google.protobuf.Option.Builder builderForValue) {
copyOnWrite();
instance.setOptions(index, builderForValue);
return this;
}
/**
*
* Any metadata attached to the API.
*
*
* repeated .google.protobuf.Option options = 3;
*/
public Builder addOptions(com.google.protobuf.Option value) {
copyOnWrite();
instance.addOptions(value);
return this;
}
/**
*
* Any metadata attached to the API.
*
*
* repeated .google.protobuf.Option options = 3;
*/
public Builder addOptions(
int index, com.google.protobuf.Option value) {
copyOnWrite();
instance.addOptions(index, value);
return this;
}
/**
*
* Any metadata attached to the API.
*
*
* repeated .google.protobuf.Option options = 3;
*/
public Builder addOptions(
com.google.protobuf.Option.Builder builderForValue) {
copyOnWrite();
instance.addOptions(builderForValue);
return this;
}
/**
*
* Any metadata attached to the API.
*
*
* repeated .google.protobuf.Option options = 3;
*/
public Builder addOptions(
int index, com.google.protobuf.Option.Builder builderForValue) {
copyOnWrite();
instance.addOptions(index, builderForValue);
return this;
}
/**
*
* Any metadata attached to the API.
*
*
* repeated .google.protobuf.Option options = 3;
*/
public Builder addAllOptions(
java.lang.Iterable extends com.google.protobuf.Option> values) {
copyOnWrite();
instance.addAllOptions(values);
return this;
}
/**
*
* Any metadata attached to the API.
*
*
* repeated .google.protobuf.Option options = 3;
*/
public Builder clearOptions() {
copyOnWrite();
instance.clearOptions();
return this;
}
/**
*
* Any metadata attached to the API.
*
*
* repeated .google.protobuf.Option options = 3;
*/
public Builder removeOptions(int index) {
copyOnWrite();
instance.removeOptions(index);
return this;
}
/**
*
* A version string for this api. If specified, must have the form
* `major-version.minor-version`, as in `1.10`. If the minor version
* is omitted, it defaults to zero. If the entire version field is
* empty, the major version is derived from the package name, as
* outlined below. If the field is not empty, the version in the
* package name will be verified to be consistent with what is
* provided here.
* The versioning schema uses [semantic
* versioning](http://semver.org) where the major version number
* indicates a breaking change and the minor version an additive,
* non-breaking change. Both version numbers are signals to users
* what to expect from different versions, and should be carefully
* chosen based on the product plan.
* The major version is also reflected in the package name of the
* API, which must end in `v<major-version>`, as in
* `google.feature.v1`. For major versions 0 and 1, the suffix can
* be omitted. Zero major versions must only be used for
* experimental, none-GA apis.
*
*
* optional string version = 4;
*/
public java.lang.String getVersion() {
return instance.getVersion();
}
/**
*
* A version string for this api. If specified, must have the form
* `major-version.minor-version`, as in `1.10`. If the minor version
* is omitted, it defaults to zero. If the entire version field is
* empty, the major version is derived from the package name, as
* outlined below. If the field is not empty, the version in the
* package name will be verified to be consistent with what is
* provided here.
* The versioning schema uses [semantic
* versioning](http://semver.org) where the major version number
* indicates a breaking change and the minor version an additive,
* non-breaking change. Both version numbers are signals to users
* what to expect from different versions, and should be carefully
* chosen based on the product plan.
* The major version is also reflected in the package name of the
* API, which must end in `v<major-version>`, as in
* `google.feature.v1`. For major versions 0 and 1, the suffix can
* be omitted. Zero major versions must only be used for
* experimental, none-GA apis.
*
*
* optional string version = 4;
*/
public com.google.protobuf.ByteString
getVersionBytes() {
return instance.getVersionBytes();
}
/**
*
* A version string for this api. If specified, must have the form
* `major-version.minor-version`, as in `1.10`. If the minor version
* is omitted, it defaults to zero. If the entire version field is
* empty, the major version is derived from the package name, as
* outlined below. If the field is not empty, the version in the
* package name will be verified to be consistent with what is
* provided here.
* The versioning schema uses [semantic
* versioning](http://semver.org) where the major version number
* indicates a breaking change and the minor version an additive,
* non-breaking change. Both version numbers are signals to users
* what to expect from different versions, and should be carefully
* chosen based on the product plan.
* The major version is also reflected in the package name of the
* API, which must end in `v<major-version>`, as in
* `google.feature.v1`. For major versions 0 and 1, the suffix can
* be omitted. Zero major versions must only be used for
* experimental, none-GA apis.
*
*
* optional string version = 4;
*/
public Builder setVersion(
java.lang.String value) {
copyOnWrite();
instance.setVersion(value);
return this;
}
/**
*
* A version string for this api. If specified, must have the form
* `major-version.minor-version`, as in `1.10`. If the minor version
* is omitted, it defaults to zero. If the entire version field is
* empty, the major version is derived from the package name, as
* outlined below. If the field is not empty, the version in the
* package name will be verified to be consistent with what is
* provided here.
* The versioning schema uses [semantic
* versioning](http://semver.org) where the major version number
* indicates a breaking change and the minor version an additive,
* non-breaking change. Both version numbers are signals to users
* what to expect from different versions, and should be carefully
* chosen based on the product plan.
* The major version is also reflected in the package name of the
* API, which must end in `v<major-version>`, as in
* `google.feature.v1`. For major versions 0 and 1, the suffix can
* be omitted. Zero major versions must only be used for
* experimental, none-GA apis.
*
*
* optional string version = 4;
*/
public Builder clearVersion() {
copyOnWrite();
instance.clearVersion();
return this;
}
/**
*
* A version string for this api. If specified, must have the form
* `major-version.minor-version`, as in `1.10`. If the minor version
* is omitted, it defaults to zero. If the entire version field is
* empty, the major version is derived from the package name, as
* outlined below. If the field is not empty, the version in the
* package name will be verified to be consistent with what is
* provided here.
* The versioning schema uses [semantic
* versioning](http://semver.org) where the major version number
* indicates a breaking change and the minor version an additive,
* non-breaking change. Both version numbers are signals to users
* what to expect from different versions, and should be carefully
* chosen based on the product plan.
* The major version is also reflected in the package name of the
* API, which must end in `v<major-version>`, as in
* `google.feature.v1`. For major versions 0 and 1, the suffix can
* be omitted. Zero major versions must only be used for
* experimental, none-GA apis.
*
*
* optional string version = 4;
*/
public Builder setVersionBytes(
com.google.protobuf.ByteString value) {
copyOnWrite();
instance.setVersionBytes(value);
return this;
}
/**
*
* Source context for the protocol buffer service represented by this
* message.
*
*
* optional .google.protobuf.SourceContext source_context = 5;
*/
public boolean hasSourceContext() {
return instance.hasSourceContext();
}
/**
*
* Source context for the protocol buffer service represented by this
* message.
*
*
* optional .google.protobuf.SourceContext source_context = 5;
*/
public com.google.protobuf.SourceContext getSourceContext() {
return instance.getSourceContext();
}
/**
*
* Source context for the protocol buffer service represented by this
* message.
*
*
* optional .google.protobuf.SourceContext source_context = 5;
*/
public Builder setSourceContext(com.google.protobuf.SourceContext value) {
copyOnWrite();
instance.setSourceContext(value);
return this;
}
/**
*
* Source context for the protocol buffer service represented by this
* message.
*
*
* optional .google.protobuf.SourceContext source_context = 5;
*/
public Builder setSourceContext(
com.google.protobuf.SourceContext.Builder builderForValue) {
copyOnWrite();
instance.setSourceContext(builderForValue);
return this;
}
/**
*
* Source context for the protocol buffer service represented by this
* message.
*
*
* optional .google.protobuf.SourceContext source_context = 5;
*/
public Builder mergeSourceContext(com.google.protobuf.SourceContext value) {
copyOnWrite();
instance.mergeSourceContext(value);
return this;
}
/**
*
* Source context for the protocol buffer service represented by this
* message.
*
*
* optional .google.protobuf.SourceContext source_context = 5;
*/
public Builder clearSourceContext() { copyOnWrite();
instance.clearSourceContext();
return this;
}
/**
*
* Included APIs. See [Mixin][].
*
*
* repeated .google.protobuf.Mixin mixins = 6;
*/
public java.util.List getMixinsList() {
return java.util.Collections.unmodifiableList(
instance.getMixinsList());
}
/**
*
* Included APIs. See [Mixin][].
*
*
* repeated .google.protobuf.Mixin mixins = 6;
*/
public int getMixinsCount() {
return instance.getMixinsCount();
}/**
*
* Included APIs. See [Mixin][].
*
*
* repeated .google.protobuf.Mixin mixins = 6;
*/
public com.google.protobuf.Mixin getMixins(int index) {
return instance.getMixins(index);
}
/**
*
* Included APIs. See [Mixin][].
*
*
* repeated .google.protobuf.Mixin mixins = 6;
*/
public Builder setMixins(
int index, com.google.protobuf.Mixin value) {
copyOnWrite();
instance.setMixins(index, value);
return this;
}
/**
*
* Included APIs. See [Mixin][].
*
*
* repeated .google.protobuf.Mixin mixins = 6;
*/
public Builder setMixins(
int index, com.google.protobuf.Mixin.Builder builderForValue) {
copyOnWrite();
instance.setMixins(index, builderForValue);
return this;
}
/**
*
* Included APIs. See [Mixin][].
*
*
* repeated .google.protobuf.Mixin mixins = 6;
*/
public Builder addMixins(com.google.protobuf.Mixin value) {
copyOnWrite();
instance.addMixins(value);
return this;
}
/**
*
* Included APIs. See [Mixin][].
*
*
* repeated .google.protobuf.Mixin mixins = 6;
*/
public Builder addMixins(
int index, com.google.protobuf.Mixin value) {
copyOnWrite();
instance.addMixins(index, value);
return this;
}
/**
*
* Included APIs. See [Mixin][].
*
*
* repeated .google.protobuf.Mixin mixins = 6;
*/
public Builder addMixins(
com.google.protobuf.Mixin.Builder builderForValue) {
copyOnWrite();
instance.addMixins(builderForValue);
return this;
}
/**
*
* Included APIs. See [Mixin][].
*
*
* repeated .google.protobuf.Mixin mixins = 6;
*/
public Builder addMixins(
int index, com.google.protobuf.Mixin.Builder builderForValue) {
copyOnWrite();
instance.addMixins(index, builderForValue);
return this;
}
/**
*
* Included APIs. See [Mixin][].
*
*
* repeated .google.protobuf.Mixin mixins = 6;
*/
public Builder addAllMixins(
java.lang.Iterable extends com.google.protobuf.Mixin> values) {
copyOnWrite();
instance.addAllMixins(values);
return this;
}
/**
*
* Included APIs. See [Mixin][].
*
*
* repeated .google.protobuf.Mixin mixins = 6;
*/
public Builder clearMixins() {
copyOnWrite();
instance.clearMixins();
return this;
}
/**
*
* Included APIs. See [Mixin][].
*
*
* repeated .google.protobuf.Mixin mixins = 6;
*/
public Builder removeMixins(int index) {
copyOnWrite();
instance.removeMixins(index);
return this;
}
/**
*
* The source syntax of the service.
*
*
* optional .google.protobuf.Syntax syntax = 7;
*/
public int getSyntaxValue() {
return instance.getSyntaxValue();
}
/**
*
* The source syntax of the service.
*
*
* optional .google.protobuf.Syntax syntax = 7;
*/
public Builder setSyntaxValue(int value) {
copyOnWrite();
instance.setSyntaxValue(value);
return this;
}
/**
*
* The source syntax of the service.
*
*
* optional .google.protobuf.Syntax syntax = 7;
*/
public com.google.protobuf.Syntax getSyntax() {
return instance.getSyntax();
}
/**
*
* The source syntax of the service.
*
*
* optional .google.protobuf.Syntax syntax = 7;
*/
public Builder setSyntax(com.google.protobuf.Syntax value) {
copyOnWrite();
instance.setSyntax(value);
return this;
}
/**
*
* The source syntax of the service.
*
*
* optional .google.protobuf.Syntax syntax = 7;
*/
public Builder clearSyntax() {
copyOnWrite();
instance.clearSyntax();
return this;
}
// @@protoc_insertion_point(builder_scope:google.protobuf.Api)
}
protected final Object dynamicMethod(
com.google.protobuf.GeneratedMessageLite.MethodToInvoke method,
Object arg0, Object arg1) {
switch (method) {
case NEW_MUTABLE_INSTANCE: {
return new com.google.protobuf.Api();
}
case IS_INITIALIZED: {
return DEFAULT_INSTANCE;
}
case MAKE_IMMUTABLE: {
methods_.makeImmutable();
options_.makeImmutable();
mixins_.makeImmutable();
return null;
}
case NEW_BUILDER: {
return new Builder();
}
case VISIT: {
Visitor visitor = (Visitor) arg0;
com.google.protobuf.Api other = (com.google.protobuf.Api) arg1;
name_ = visitor.visitString(!name_.isEmpty(), name_,
!other.name_.isEmpty(), other.name_);
methods_= visitor.visitList(methods_, other.methods_);
options_= visitor.visitList(options_, other.options_);
version_ = visitor.visitString(!version_.isEmpty(), version_,
!other.version_.isEmpty(), other.version_);
sourceContext_ = visitor.visitMessage(sourceContext_, other.sourceContext_);
mixins_= visitor.visitList(mixins_, other.mixins_);
syntax_ = visitor.visitInt(syntax_ != 0, syntax_, other.syntax_ != 0, other.syntax_);
if (visitor == com.google.protobuf.GeneratedMessageLite.MergeFromVisitor
.INSTANCE) {
bitField0_ |= other.bitField0_;
}
return this;
}
case MERGE_FROM_STREAM: {
com.google.protobuf.CodedInputStream input =
(com.google.protobuf.CodedInputStream) arg0;
com.google.protobuf.ExtensionRegistryLite extensionRegistry =
(com.google.protobuf.ExtensionRegistryLite) arg1;
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!input.skipField(tag)) {
done = true;
}
break;
}
case 10: {
String s = input.readStringRequireUtf8();
name_ = s;
break;
}
case 18: {
if (!methods_.isModifiable()) {
methods_ =
com.google.protobuf.GeneratedMessageLite.mutableCopy(methods_);
}
methods_.add(
input.readMessage(com.google.protobuf.Method.parser(), extensionRegistry));
break;
}
case 26: {
if (!options_.isModifiable()) {
options_ =
com.google.protobuf.GeneratedMessageLite.mutableCopy(options_);
}
options_.add(
input.readMessage(com.google.protobuf.Option.parser(), extensionRegistry));
break;
}
case 34: {
String s = input.readStringRequireUtf8();
version_ = s;
break;
}
case 42: {
com.google.protobuf.SourceContext.Builder subBuilder = null;
if (sourceContext_ != null) {
subBuilder = sourceContext_.toBuilder();
}
sourceContext_ = input.readMessage(com.google.protobuf.SourceContext.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(sourceContext_);
sourceContext_ = subBuilder.buildPartial();
}
break;
}
case 50: {
if (!mixins_.isModifiable()) {
mixins_ =
com.google.protobuf.GeneratedMessageLite.mutableCopy(mixins_);
}
mixins_.add(
input.readMessage(com.google.protobuf.Mixin.parser(), extensionRegistry));
break;
}
case 56: {
int rawValue = input.readEnum();
syntax_ = rawValue;
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw new RuntimeException(e.setUnfinishedMessage(this));
} catch (java.io.IOException e) {
throw new RuntimeException(
new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this));
} finally {
}
}
case GET_DEFAULT_INSTANCE: {
return DEFAULT_INSTANCE;
}
case GET_PARSER: {
if (PARSER == null) { synchronized (com.google.protobuf.Api.class) {
if (PARSER == null) {
PARSER = new DefaultInstanceBasedParser(DEFAULT_INSTANCE);
}
}
}
return PARSER;
}
}
throw new UnsupportedOperationException();
}
// @@protoc_insertion_point(class_scope:google.protobuf.Api)
private static final com.google.protobuf.Api DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new Api();
DEFAULT_INSTANCE.makeImmutable();
}
public static com.google.protobuf.Api getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static volatile com.google.protobuf.Parser PARSER;
public static com.google.protobuf.Parser parser() {
return DEFAULT_INSTANCE.getParserForType();
}
}