/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: counter.proto

package com.alipay.sofa.jraft.example.counter.rpc;

public final class CounterOutter {
    private CounterOutter() {
    }

    public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {
    }

    public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) {
        registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry);
    }

    public interface GetValueRequestOrBuilder extends
    // @@protoc_insertion_point(interface_extends:jraft.GetValueRequest)
                                             com.google.protobuf.MessageOrBuilder {

        /**
         * <code>required bool readOnlySafe = 1;</code>
         */
        boolean hasReadOnlySafe();

        /**
         * <code>required bool readOnlySafe = 1;</code>
         */
        boolean getReadOnlySafe();
    }

    /**
     * Protobuf type {@code jraft.GetValueRequest}
     */
    public static final class GetValueRequest extends com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:jraft.GetValueRequest)
                                                                                            GetValueRequestOrBuilder {
        private static final long serialVersionUID = 0L;

        // Use GetValueRequest.newBuilder() to construct.
        private GetValueRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
            super(builder);
        }

        private GetValueRequest() {
            readOnlySafe_ = false;
        }

        @Override
        public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
            return this.unknownFields;
        }

        private GetValueRequest(com.google.protobuf.CodedInputStream input,
                                com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                                                            throws com.google.protobuf.InvalidProtocolBufferException {
            this();
            if (extensionRegistry == null) {
                throw new NullPointerException();
            }
            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 8: {
                            bitField0_ |= 0x00000001;
                            readOnlySafe_ = input.readBool();
                            break;
                        }
                    }
                }
            } catch (com.google.protobuf.InvalidProtocolBufferException e) {
                throw e.setUnfinishedMessage(this);
            } catch (java.io.IOException e) {
                throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
            } finally {
                this.unknownFields = unknownFields.build();
                makeExtensionsImmutable();
            }
        }

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
            return CounterOutter.internal_static_jraft_GetValueRequest_descriptor;
        }

        protected FieldAccessorTable internalGetFieldAccessorTable() {
            return CounterOutter.internal_static_jraft_GetValueRequest_fieldAccessorTable
                .ensureFieldAccessorsInitialized(GetValueRequest.class, Builder.class);
        }

        private int             bitField0_;
        public static final int READONLYSAFE_FIELD_NUMBER = 1;
        private boolean         readOnlySafe_;

        /**
         * <code>required bool readOnlySafe = 1;</code>
         */
        public boolean hasReadOnlySafe() {
            return ((bitField0_ & 0x00000001) == 0x00000001);
        }

        /**
         * <code>required bool readOnlySafe = 1;</code>
         */
        public boolean getReadOnlySafe() {
            return readOnlySafe_;
        }

        private byte memoizedIsInitialized = -1;

        public final boolean isInitialized() {
            byte isInitialized = memoizedIsInitialized;
            if (isInitialized == 1)
                return true;
            if (isInitialized == 0)
                return false;

            if (!hasReadOnlySafe()) {
                memoizedIsInitialized = 0;
                return false;
            }
            memoizedIsInitialized = 1;
            return true;
        }

        public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
            if (((bitField0_ & 0x00000001) == 0x00000001)) {
                output.writeBool(1, readOnlySafe_);
            }
            unknownFields.writeTo(output);
        }

        public int getSerializedSize() {
            int size = memoizedSize;
            if (size != -1)
                return size;

            size = 0;
            if (((bitField0_ & 0x00000001) == 0x00000001)) {
                size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, readOnlySafe_);
            }
            size += unknownFields.getSerializedSize();
            memoizedSize = size;
            return size;
        }

        @Override
        public boolean equals(final Object obj) {
            if (obj == this) {
                return true;
            }
            if (!(obj instanceof GetValueRequest)) {
                return super.equals(obj);
            }
            GetValueRequest other = (GetValueRequest) obj;

            boolean result = true;
            result = result && (hasReadOnlySafe() == other.hasReadOnlySafe());
            if (hasReadOnlySafe()) {
                result = result && (getReadOnlySafe() == other.getReadOnlySafe());
            }
            result = result && unknownFields.equals(other.unknownFields);
            return result;
        }

        @Override
        public int hashCode() {
            if (memoizedHashCode != 0) {
                return memoizedHashCode;
            }
            int hash = 41;
            hash = (19 * hash) + getDescriptor().hashCode();
            if (hasReadOnlySafe()) {
                hash = (37 * hash) + READONLYSAFE_FIELD_NUMBER;
                hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReadOnlySafe());
            }
            hash = (29 * hash) + unknownFields.hashCode();
            memoizedHashCode = hash;
            return hash;
        }

        public static GetValueRequest parseFrom(java.nio.ByteBuffer data)
                                                                         throws com.google.protobuf.InvalidProtocolBufferException {
            return PARSER.parseFrom(data);
        }

        public static GetValueRequest parseFrom(java.nio.ByteBuffer data,
                                                com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                                                                            throws com.google.protobuf.InvalidProtocolBufferException {
            return PARSER.parseFrom(data, extensionRegistry);
        }

        public static GetValueRequest parseFrom(com.google.protobuf.ByteString data)
                                                                                    throws com.google.protobuf.InvalidProtocolBufferException {
            return PARSER.parseFrom(data);
        }

        public static GetValueRequest parseFrom(com.google.protobuf.ByteString data,
                                                com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                                                                            throws com.google.protobuf.InvalidProtocolBufferException {
            return PARSER.parseFrom(data, extensionRegistry);
        }

        public static GetValueRequest parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
            return PARSER.parseFrom(data);
        }

        public static GetValueRequest parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                                                                                         throws com.google.protobuf.InvalidProtocolBufferException {
            return PARSER.parseFrom(data, extensionRegistry);
        }

        public static GetValueRequest parseFrom(java.io.InputStream input) throws java.io.IOException {
            return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        }

        public static GetValueRequest parseFrom(java.io.InputStream input,
                                                com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                                                                            throws java.io.IOException {
            return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry);
        }

        public static GetValueRequest parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException {
            return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
        }

        public static GetValueRequest parseDelimitedFrom(java.io.InputStream input,
                                                         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                                                                                     throws java.io.IOException {
            return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input,
                extensionRegistry);
        }

        public static GetValueRequest parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException {
            return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        }

        public static GetValueRequest parseFrom(com.google.protobuf.CodedInputStream input,
                                                com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                                                                            throws java.io.IOException {
            return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry);
        }

        public Builder newBuilderForType() {
            return newBuilder();
        }

        public static Builder newBuilder() {
            return DEFAULT_INSTANCE.toBuilder();
        }

        public static Builder newBuilder(GetValueRequest prototype) {
            return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
        }

        public Builder toBuilder() {
            return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
        }

        @Override
        protected Builder newBuilderForType(BuilderParent parent) {
            Builder builder = new Builder(parent);
            return builder;
        }

        /**
         * Protobuf type {@code jraft.GetValueRequest}
         */
        public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
        // @@protoc_insertion_point(builder_implements:jraft.GetValueRequest)
                                                                                                         GetValueRequestOrBuilder {
            public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
                return CounterOutter.internal_static_jraft_GetValueRequest_descriptor;
            }

            protected FieldAccessorTable internalGetFieldAccessorTable() {
                return CounterOutter.internal_static_jraft_GetValueRequest_fieldAccessorTable
                    .ensureFieldAccessorsInitialized(GetValueRequest.class, Builder.class);
            }

            // Construct using com.alipay.sofa.jraft.example.counter.rpc.CounterOutter.GetValueRequest.newBuilder()
            private Builder() {
                maybeForceBuilderInitialization();
            }

            private Builder(BuilderParent parent) {
                super(parent);
                maybeForceBuilderInitialization();
            }

            private void maybeForceBuilderInitialization() {
                if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
                }
            }

            public Builder clear() {
                super.clear();
                readOnlySafe_ = false;
                bitField0_ = (bitField0_ & ~0x00000001);
                return this;
            }

            public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
                return CounterOutter.internal_static_jraft_GetValueRequest_descriptor;
            }

            public GetValueRequest getDefaultInstanceForType() {
                return GetValueRequest.getDefaultInstance();
            }

            public GetValueRequest build() {
                GetValueRequest result = buildPartial();
                if (!result.isInitialized()) {
                    throw newUninitializedMessageException(result);
                }
                return result;
            }

            public GetValueRequest buildPartial() {
                GetValueRequest result = new GetValueRequest(this);
                int from_bitField0_ = bitField0_;
                int to_bitField0_ = 0;
                if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
                    to_bitField0_ |= 0x00000001;
                }
                result.readOnlySafe_ = readOnlySafe_;
                result.bitField0_ = to_bitField0_;
                onBuilt();
                return result;
            }

            public Builder clone() {
                return (Builder) super.clone();
            }

            public Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) {
                return (Builder) super.setField(field, value);
            }

            public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
                return (Builder) super.clearField(field);
            }

            public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
                return (Builder) super.clearOneof(oneof);
            }

            public Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index,
                                            Object value) {
                return (Builder) super.setRepeatedField(field, index, value);
            }

            public Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) {
                return (Builder) super.addRepeatedField(field, value);
            }

            public Builder mergeFrom(com.google.protobuf.Message other) {
                if (other instanceof GetValueRequest) {
                    return mergeFrom((GetValueRequest) other);
                } else {
                    super.mergeFrom(other);
                    return this;
                }
            }

            public Builder mergeFrom(GetValueRequest other) {
                if (other == GetValueRequest.getDefaultInstance())
                    return this;
                if (other.hasReadOnlySafe()) {
                    setReadOnlySafe(other.getReadOnlySafe());
                }
                this.mergeUnknownFields(other.unknownFields);
                onChanged();
                return this;
            }

            public final boolean isInitialized() {
                if (!hasReadOnlySafe()) {
                    return false;
                }
                return true;
            }

            public Builder mergeFrom(com.google.protobuf.CodedInputStream input,
                                     com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                                                                 throws java.io.IOException {
                GetValueRequest parsedMessage = null;
                try {
                    parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
                } catch (com.google.protobuf.InvalidProtocolBufferException e) {
                    parsedMessage = (GetValueRequest) e.getUnfinishedMessage();
                    throw e.unwrapIOException();
                } finally {
                    if (parsedMessage != null) {
                        mergeFrom(parsedMessage);
                    }
                }
                return this;
            }

            private int     bitField0_;

            private boolean readOnlySafe_;

            /**
             * <code>required bool readOnlySafe = 1;</code>
             */
            public boolean hasReadOnlySafe() {
                return ((bitField0_ & 0x00000001) == 0x00000001);
            }

            /**
             * <code>required bool readOnlySafe = 1;</code>
             */
            public boolean getReadOnlySafe() {
                return readOnlySafe_;
            }

            /**
             * <code>required bool readOnlySafe = 1;</code>
             */
            public Builder setReadOnlySafe(boolean value) {
                bitField0_ |= 0x00000001;
                readOnlySafe_ = value;
                onChanged();
                return this;
            }

            /**
             * <code>required bool readOnlySafe = 1;</code>
             */
            public Builder clearReadOnlySafe() {
                bitField0_ = (bitField0_ & ~0x00000001);
                readOnlySafe_ = false;
                onChanged();
                return this;
            }

            public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
                return super.setUnknownFields(unknownFields);
            }

            public final Builder mergeUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
                return super.mergeUnknownFields(unknownFields);
            }

            // @@protoc_insertion_point(builder_scope:jraft.GetValueRequest)
        }

        // @@protoc_insertion_point(class_scope:jraft.GetValueRequest)
        private static final GetValueRequest DEFAULT_INSTANCE;
        static {
            DEFAULT_INSTANCE = new GetValueRequest();
        }

        public static GetValueRequest getDefaultInstance() {
            return DEFAULT_INSTANCE;
        }

        @Deprecated
        public static final com.google.protobuf.Parser<GetValueRequest> PARSER = new com.google.protobuf.AbstractParser<GetValueRequest>() {
                                                                                   public GetValueRequest parsePartialFrom(com.google.protobuf.CodedInputStream input,
                                                                                                                           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                                                                                                                                                       throws com.google.protobuf.InvalidProtocolBufferException {
                                                                                       return new GetValueRequest(
                                                                                           input, extensionRegistry);
                                                                                   }
                                                                               };

        public static com.google.protobuf.Parser<GetValueRequest> parser() {
            return PARSER;
        }

        @Override
        public com.google.protobuf.Parser<GetValueRequest> getParserForType() {
            return PARSER;
        }

        public GetValueRequest getDefaultInstanceForType() {
            return DEFAULT_INSTANCE;
        }

    }

    public interface IncrementAndGetRequestOrBuilder extends
    // @@protoc_insertion_point(interface_extends:jraft.IncrementAndGetRequest)
                                                    com.google.protobuf.MessageOrBuilder {

        /**
         * <code>required int64 delta = 1;</code>
         */
        boolean hasDelta();

        /**
         * <code>required int64 delta = 1;</code>
         */
        long getDelta();
    }

    /**
     * Protobuf type {@code jraft.IncrementAndGetRequest}
     */
    public static final class IncrementAndGetRequest extends com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:jraft.IncrementAndGetRequest)
                                                                                                   IncrementAndGetRequestOrBuilder {
        private static final long serialVersionUID = 0L;

        // Use IncrementAndGetRequest.newBuilder() to construct.
        private IncrementAndGetRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
            super(builder);
        }

        private IncrementAndGetRequest() {
            delta_ = 0L;
        }

        @Override
        public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
            return this.unknownFields;
        }

        private IncrementAndGetRequest(com.google.protobuf.CodedInputStream input,
                                       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                                                                   throws com.google.protobuf.InvalidProtocolBufferException {
            this();
            if (extensionRegistry == null) {
                throw new NullPointerException();
            }
            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 8: {
                            bitField0_ |= 0x00000001;
                            delta_ = input.readInt64();
                            break;
                        }
                    }
                }
            } catch (com.google.protobuf.InvalidProtocolBufferException e) {
                throw e.setUnfinishedMessage(this);
            } catch (java.io.IOException e) {
                throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
            } finally {
                this.unknownFields = unknownFields.build();
                makeExtensionsImmutable();
            }
        }

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
            return CounterOutter.internal_static_jraft_IncrementAndGetRequest_descriptor;
        }

        protected FieldAccessorTable internalGetFieldAccessorTable() {
            return CounterOutter.internal_static_jraft_IncrementAndGetRequest_fieldAccessorTable
                .ensureFieldAccessorsInitialized(IncrementAndGetRequest.class, Builder.class);
        }

        private int             bitField0_;
        public static final int DELTA_FIELD_NUMBER = 1;
        private long            delta_;

        /**
         * <code>required int64 delta = 1;</code>
         */
        public boolean hasDelta() {
            return ((bitField0_ & 0x00000001) == 0x00000001);
        }

        /**
         * <code>required int64 delta = 1;</code>
         */
        public long getDelta() {
            return delta_;
        }

        private byte memoizedIsInitialized = -1;

        public final boolean isInitialized() {
            byte isInitialized = memoizedIsInitialized;
            if (isInitialized == 1)
                return true;
            if (isInitialized == 0)
                return false;

            if (!hasDelta()) {
                memoizedIsInitialized = 0;
                return false;
            }
            memoizedIsInitialized = 1;
            return true;
        }

        public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
            if (((bitField0_ & 0x00000001) == 0x00000001)) {
                output.writeInt64(1, delta_);
            }
            unknownFields.writeTo(output);
        }

        public int getSerializedSize() {
            int size = memoizedSize;
            if (size != -1)
                return size;

            size = 0;
            if (((bitField0_ & 0x00000001) == 0x00000001)) {
                size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, delta_);
            }
            size += unknownFields.getSerializedSize();
            memoizedSize = size;
            return size;
        }

        @Override
        public boolean equals(final Object obj) {
            if (obj == this) {
                return true;
            }
            if (!(obj instanceof IncrementAndGetRequest)) {
                return super.equals(obj);
            }
            IncrementAndGetRequest other = (IncrementAndGetRequest) obj;

            boolean result = true;
            result = result && (hasDelta() == other.hasDelta());
            if (hasDelta()) {
                result = result && (getDelta() == other.getDelta());
            }
            result = result && unknownFields.equals(other.unknownFields);
            return result;
        }

        @Override
        public int hashCode() {
            if (memoizedHashCode != 0) {
                return memoizedHashCode;
            }
            int hash = 41;
            hash = (19 * hash) + getDescriptor().hashCode();
            if (hasDelta()) {
                hash = (37 * hash) + DELTA_FIELD_NUMBER;
                hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getDelta());
            }
            hash = (29 * hash) + unknownFields.hashCode();
            memoizedHashCode = hash;
            return hash;
        }

        public static IncrementAndGetRequest parseFrom(java.nio.ByteBuffer data)
                                                                                throws com.google.protobuf.InvalidProtocolBufferException {
            return PARSER.parseFrom(data);
        }

        public static IncrementAndGetRequest parseFrom(java.nio.ByteBuffer data,
                                                       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                                                                                   throws com.google.protobuf.InvalidProtocolBufferException {
            return PARSER.parseFrom(data, extensionRegistry);
        }

        public static IncrementAndGetRequest parseFrom(com.google.protobuf.ByteString data)
                                                                                           throws com.google.protobuf.InvalidProtocolBufferException {
            return PARSER.parseFrom(data);
        }

        public static IncrementAndGetRequest parseFrom(com.google.protobuf.ByteString data,
                                                       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                                                                                   throws com.google.protobuf.InvalidProtocolBufferException {
            return PARSER.parseFrom(data, extensionRegistry);
        }

        public static IncrementAndGetRequest parseFrom(byte[] data)
                                                                   throws com.google.protobuf.InvalidProtocolBufferException {
            return PARSER.parseFrom(data);
        }

        public static IncrementAndGetRequest parseFrom(byte[] data,
                                                       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                                                                                   throws com.google.protobuf.InvalidProtocolBufferException {
            return PARSER.parseFrom(data, extensionRegistry);
        }

        public static IncrementAndGetRequest parseFrom(java.io.InputStream input) throws java.io.IOException {
            return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        }

        public static IncrementAndGetRequest parseFrom(java.io.InputStream input,
                                                       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                                                                                   throws java.io.IOException {
            return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry);
        }

        public static IncrementAndGetRequest parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException {
            return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
        }

        public static IncrementAndGetRequest parseDelimitedFrom(java.io.InputStream input,
                                                                com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                                                                                            throws java.io.IOException {
            return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input,
                extensionRegistry);
        }

        public static IncrementAndGetRequest parseFrom(com.google.protobuf.CodedInputStream input)
                                                                                                  throws java.io.IOException {
            return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        }

        public static IncrementAndGetRequest parseFrom(com.google.protobuf.CodedInputStream input,
                                                       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                                                                                   throws java.io.IOException {
            return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry);
        }

        public Builder newBuilderForType() {
            return newBuilder();
        }

        public static Builder newBuilder() {
            return DEFAULT_INSTANCE.toBuilder();
        }

        public static Builder newBuilder(IncrementAndGetRequest prototype) {
            return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
        }

        public Builder toBuilder() {
            return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
        }

        @Override
        protected Builder newBuilderForType(BuilderParent parent) {
            Builder builder = new Builder(parent);
            return builder;
        }

        /**
         * Protobuf type {@code jraft.IncrementAndGetRequest}
         */
        public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
        // @@protoc_insertion_point(builder_implements:jraft.IncrementAndGetRequest)
                                                                                                         IncrementAndGetRequestOrBuilder {
            public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
                return CounterOutter.internal_static_jraft_IncrementAndGetRequest_descriptor;
            }

            protected FieldAccessorTable internalGetFieldAccessorTable() {
                return CounterOutter.internal_static_jraft_IncrementAndGetRequest_fieldAccessorTable
                    .ensureFieldAccessorsInitialized(IncrementAndGetRequest.class, Builder.class);
            }

            // Construct using com.alipay.sofa.jraft.example.counter.rpc.CounterOutter.IncrementAndGetRequest.newBuilder()
            private Builder() {
                maybeForceBuilderInitialization();
            }

            private Builder(BuilderParent parent) {
                super(parent);
                maybeForceBuilderInitialization();
            }

            private void maybeForceBuilderInitialization() {
                if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
                }
            }

            public Builder clear() {
                super.clear();
                delta_ = 0L;
                bitField0_ = (bitField0_ & ~0x00000001);
                return this;
            }

            public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
                return CounterOutter.internal_static_jraft_IncrementAndGetRequest_descriptor;
            }

            public IncrementAndGetRequest getDefaultInstanceForType() {
                return IncrementAndGetRequest.getDefaultInstance();
            }

            public IncrementAndGetRequest build() {
                IncrementAndGetRequest result = buildPartial();
                if (!result.isInitialized()) {
                    throw newUninitializedMessageException(result);
                }
                return result;
            }

            public IncrementAndGetRequest buildPartial() {
                IncrementAndGetRequest result = new IncrementAndGetRequest(this);
                int from_bitField0_ = bitField0_;
                int to_bitField0_ = 0;
                if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
                    to_bitField0_ |= 0x00000001;
                }
                result.delta_ = delta_;
                result.bitField0_ = to_bitField0_;
                onBuilt();
                return result;
            }

            public Builder clone() {
                return (Builder) super.clone();
            }

            public Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) {
                return (Builder) super.setField(field, value);
            }

            public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
                return (Builder) super.clearField(field);
            }

            public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
                return (Builder) super.clearOneof(oneof);
            }

            public Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index,
                                            Object value) {
                return (Builder) super.setRepeatedField(field, index, value);
            }

            public Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) {
                return (Builder) super.addRepeatedField(field, value);
            }

            public Builder mergeFrom(com.google.protobuf.Message other) {
                if (other instanceof IncrementAndGetRequest) {
                    return mergeFrom((IncrementAndGetRequest) other);
                } else {
                    super.mergeFrom(other);
                    return this;
                }
            }

            public Builder mergeFrom(IncrementAndGetRequest other) {
                if (other == IncrementAndGetRequest.getDefaultInstance())
                    return this;
                if (other.hasDelta()) {
                    setDelta(other.getDelta());
                }
                this.mergeUnknownFields(other.unknownFields);
                onChanged();
                return this;
            }

            public final boolean isInitialized() {
                if (!hasDelta()) {
                    return false;
                }
                return true;
            }

            public Builder mergeFrom(com.google.protobuf.CodedInputStream input,
                                     com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                                                                 throws java.io.IOException {
                IncrementAndGetRequest parsedMessage = null;
                try {
                    parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
                } catch (com.google.protobuf.InvalidProtocolBufferException e) {
                    parsedMessage = (IncrementAndGetRequest) e.getUnfinishedMessage();
                    throw e.unwrapIOException();
                } finally {
                    if (parsedMessage != null) {
                        mergeFrom(parsedMessage);
                    }
                }
                return this;
            }

            private int  bitField0_;

            private long delta_;

            /**
             * <code>required int64 delta = 1;</code>
             */
            public boolean hasDelta() {
                return ((bitField0_ & 0x00000001) == 0x00000001);
            }

            /**
             * <code>required int64 delta = 1;</code>
             */
            public long getDelta() {
                return delta_;
            }

            /**
             * <code>required int64 delta = 1;</code>
             */
            public Builder setDelta(long value) {
                bitField0_ |= 0x00000001;
                delta_ = value;
                onChanged();
                return this;
            }

            /**
             * <code>required int64 delta = 1;</code>
             */
            public Builder clearDelta() {
                bitField0_ = (bitField0_ & ~0x00000001);
                delta_ = 0L;
                onChanged();
                return this;
            }

            public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
                return super.setUnknownFields(unknownFields);
            }

            public final Builder mergeUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
                return super.mergeUnknownFields(unknownFields);
            }

            // @@protoc_insertion_point(builder_scope:jraft.IncrementAndGetRequest)
        }

        // @@protoc_insertion_point(class_scope:jraft.IncrementAndGetRequest)
        private static final IncrementAndGetRequest DEFAULT_INSTANCE;
        static {
            DEFAULT_INSTANCE = new IncrementAndGetRequest();
        }

        public static IncrementAndGetRequest getDefaultInstance() {
            return DEFAULT_INSTANCE;
        }

        @Deprecated
        public static final com.google.protobuf.Parser<IncrementAndGetRequest> PARSER = new com.google.protobuf.AbstractParser<IncrementAndGetRequest>() {
                                                                                          public IncrementAndGetRequest parsePartialFrom(com.google.protobuf.CodedInputStream input,
                                                                                                                                         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                                                                                                                                                                     throws com.google.protobuf.InvalidProtocolBufferException {
                                                                                              return new IncrementAndGetRequest(
                                                                                                  input,
                                                                                                  extensionRegistry);
                                                                                          }
                                                                                      };

        public static com.google.protobuf.Parser<IncrementAndGetRequest> parser() {
            return PARSER;
        }

        @Override
        public com.google.protobuf.Parser<IncrementAndGetRequest> getParserForType() {
            return PARSER;
        }

        public IncrementAndGetRequest getDefaultInstanceForType() {
            return DEFAULT_INSTANCE;
        }

    }

    public interface ValueResponseOrBuilder extends
    // @@protoc_insertion_point(interface_extends:jraft.ValueResponse)
                                           com.google.protobuf.MessageOrBuilder {

        /**
         * <code>required int64 value = 1;</code>
         */
        boolean hasValue();

        /**
         * <code>required int64 value = 1;</code>
         */
        long getValue();

        /**
         * <code>required bool success = 2;</code>
         */
        boolean hasSuccess();

        /**
         * <code>required bool success = 2;</code>
         */
        boolean getSuccess();

        /**
         * <code>optional string redirect = 3;</code>
         */
        boolean hasRedirect();

        /**
         * <code>optional string redirect = 3;</code>
         */
        String getRedirect();

        /**
         * <code>optional string redirect = 3;</code>
         */
        com.google.protobuf.ByteString getRedirectBytes();

        /**
         * <code>optional string errorMsg = 4;</code>
         */
        boolean hasErrorMsg();

        /**
         * <code>optional string errorMsg = 4;</code>
         */
        String getErrorMsg();

        /**
         * <code>optional string errorMsg = 4;</code>
         */
        com.google.protobuf.ByteString getErrorMsgBytes();
    }

    /**
     * Protobuf type {@code jraft.ValueResponse}
     */
    public static final class ValueResponse extends com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:jraft.ValueResponse)
                                                                                          ValueResponseOrBuilder {
        private static final long serialVersionUID = 0L;

        // Use ValueResponse.newBuilder() to construct.
        private ValueResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
            super(builder);
        }

        private ValueResponse() {
            value_ = 0L;
            success_ = false;
            redirect_ = "";
            errorMsg_ = "";
        }

        @Override
        public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
            return this.unknownFields;
        }

        private ValueResponse(com.google.protobuf.CodedInputStream input,
                              com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                                                          throws com.google.protobuf.InvalidProtocolBufferException {
            this();
            if (extensionRegistry == null) {
                throw new NullPointerException();
            }
            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 8: {
                            bitField0_ |= 0x00000001;
                            value_ = input.readInt64();
                            break;
                        }
                        case 16: {
                            bitField0_ |= 0x00000002;
                            success_ = input.readBool();
                            break;
                        }
                        case 26: {
                            com.google.protobuf.ByteString bs = input.readBytes();
                            bitField0_ |= 0x00000004;
                            redirect_ = bs;
                            break;
                        }
                        case 34: {
                            com.google.protobuf.ByteString bs = input.readBytes();
                            bitField0_ |= 0x00000008;
                            errorMsg_ = bs;
                            break;
                        }
                    }
                }
            } catch (com.google.protobuf.InvalidProtocolBufferException e) {
                throw e.setUnfinishedMessage(this);
            } catch (java.io.IOException e) {
                throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
            } finally {
                this.unknownFields = unknownFields.build();
                makeExtensionsImmutable();
            }
        }

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
            return CounterOutter.internal_static_jraft_ValueResponse_descriptor;
        }

        protected FieldAccessorTable internalGetFieldAccessorTable() {
            return CounterOutter.internal_static_jraft_ValueResponse_fieldAccessorTable
                .ensureFieldAccessorsInitialized(ValueResponse.class, Builder.class);
        }

        private int             bitField0_;
        public static final int VALUE_FIELD_NUMBER = 1;
        private long            value_;

        /**
         * <code>required int64 value = 1;</code>
         */
        public boolean hasValue() {
            return ((bitField0_ & 0x00000001) == 0x00000001);
        }

        /**
         * <code>required int64 value = 1;</code>
         */
        public long getValue() {
            return value_;
        }

        public static final int SUCCESS_FIELD_NUMBER = 2;
        private boolean         success_;

        /**
         * <code>required bool success = 2;</code>
         */
        public boolean hasSuccess() {
            return ((bitField0_ & 0x00000002) == 0x00000002);
        }

        /**
         * <code>required bool success = 2;</code>
         */
        public boolean getSuccess() {
            return success_;
        }

        public static final int REDIRECT_FIELD_NUMBER = 3;
        private volatile Object redirect_;

        /**
         * <code>optional string redirect = 3;</code>
         */
        public boolean hasRedirect() {
            return ((bitField0_ & 0x00000004) == 0x00000004);
        }

        /**
         * <code>optional string redirect = 3;</code>
         */
        public String getRedirect() {
            Object ref = redirect_;
            if (ref instanceof String) {
                return (String) ref;
            } else {
                com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
                String s = bs.toStringUtf8();
                if (bs.isValidUtf8()) {
                    redirect_ = s;
                }
                return s;
            }
        }

        /**
         * <code>optional string redirect = 3;</code>
         */
        public com.google.protobuf.ByteString getRedirectBytes() {
            Object ref = redirect_;
            if (ref instanceof String) {
                com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref);
                redirect_ = b;
                return b;
            } else {
                return (com.google.protobuf.ByteString) ref;
            }
        }

        public static final int ERRORMSG_FIELD_NUMBER = 4;
        private volatile Object errorMsg_;

        /**
         * <code>optional string errorMsg = 4;</code>
         */
        public boolean hasErrorMsg() {
            return ((bitField0_ & 0x00000008) == 0x00000008);
        }

        /**
         * <code>optional string errorMsg = 4;</code>
         */
        public String getErrorMsg() {
            Object ref = errorMsg_;
            if (ref instanceof String) {
                return (String) ref;
            } else {
                com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
                String s = bs.toStringUtf8();
                if (bs.isValidUtf8()) {
                    errorMsg_ = s;
                }
                return s;
            }
        }

        /**
         * <code>optional string errorMsg = 4;</code>
         */
        public com.google.protobuf.ByteString getErrorMsgBytes() {
            Object ref = errorMsg_;
            if (ref instanceof String) {
                com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref);
                errorMsg_ = b;
                return b;
            } else {
                return (com.google.protobuf.ByteString) ref;
            }
        }

        private byte memoizedIsInitialized = -1;

        public final boolean isInitialized() {
            byte isInitialized = memoizedIsInitialized;
            if (isInitialized == 1)
                return true;
            if (isInitialized == 0)
                return false;

            if (!hasValue()) {
                memoizedIsInitialized = 0;
                return false;
            }
            if (!hasSuccess()) {
                memoizedIsInitialized = 0;
                return false;
            }
            memoizedIsInitialized = 1;
            return true;
        }

        public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
            if (((bitField0_ & 0x00000001) == 0x00000001)) {
                output.writeInt64(1, value_);
            }
            if (((bitField0_ & 0x00000002) == 0x00000002)) {
                output.writeBool(2, success_);
            }
            if (((bitField0_ & 0x00000004) == 0x00000004)) {
                com.google.protobuf.GeneratedMessageV3.writeString(output, 3, redirect_);
            }
            if (((bitField0_ & 0x00000008) == 0x00000008)) {
                com.google.protobuf.GeneratedMessageV3.writeString(output, 4, errorMsg_);
            }
            unknownFields.writeTo(output);
        }

        public int getSerializedSize() {
            int size = memoizedSize;
            if (size != -1)
                return size;

            size = 0;
            if (((bitField0_ & 0x00000001) == 0x00000001)) {
                size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, value_);
            }
            if (((bitField0_ & 0x00000002) == 0x00000002)) {
                size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, success_);
            }
            if (((bitField0_ & 0x00000004) == 0x00000004)) {
                size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, redirect_);
            }
            if (((bitField0_ & 0x00000008) == 0x00000008)) {
                size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, errorMsg_);
            }
            size += unknownFields.getSerializedSize();
            memoizedSize = size;
            return size;
        }

        @Override
        public boolean equals(final Object obj) {
            if (obj == this) {
                return true;
            }
            if (!(obj instanceof ValueResponse)) {
                return super.equals(obj);
            }
            ValueResponse other = (ValueResponse) obj;

            boolean result = true;
            result = result && (hasValue() == other.hasValue());
            if (hasValue()) {
                result = result && (getValue() == other.getValue());
            }
            result = result && (hasSuccess() == other.hasSuccess());
            if (hasSuccess()) {
                result = result && (getSuccess() == other.getSuccess());
            }
            result = result && (hasRedirect() == other.hasRedirect());
            if (hasRedirect()) {
                result = result && getRedirect().equals(other.getRedirect());
            }
            result = result && (hasErrorMsg() == other.hasErrorMsg());
            if (hasErrorMsg()) {
                result = result && getErrorMsg().equals(other.getErrorMsg());
            }
            result = result && unknownFields.equals(other.unknownFields);
            return result;
        }

        @Override
        public int hashCode() {
            if (memoizedHashCode != 0) {
                return memoizedHashCode;
            }
            int hash = 41;
            hash = (19 * hash) + getDescriptor().hashCode();
            if (hasValue()) {
                hash = (37 * hash) + VALUE_FIELD_NUMBER;
                hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getValue());
            }
            if (hasSuccess()) {
                hash = (37 * hash) + SUCCESS_FIELD_NUMBER;
                hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSuccess());
            }
            if (hasRedirect()) {
                hash = (37 * hash) + REDIRECT_FIELD_NUMBER;
                hash = (53 * hash) + getRedirect().hashCode();
            }
            if (hasErrorMsg()) {
                hash = (37 * hash) + ERRORMSG_FIELD_NUMBER;
                hash = (53 * hash) + getErrorMsg().hashCode();
            }
            hash = (29 * hash) + unknownFields.hashCode();
            memoizedHashCode = hash;
            return hash;
        }

        public static ValueResponse parseFrom(java.nio.ByteBuffer data)
                                                                       throws com.google.protobuf.InvalidProtocolBufferException {
            return PARSER.parseFrom(data);
        }

        public static ValueResponse parseFrom(java.nio.ByteBuffer data,
                                              com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                                                                          throws com.google.protobuf.InvalidProtocolBufferException {
            return PARSER.parseFrom(data, extensionRegistry);
        }

        public static ValueResponse parseFrom(com.google.protobuf.ByteString data)
                                                                                  throws com.google.protobuf.InvalidProtocolBufferException {
            return PARSER.parseFrom(data);
        }

        public static ValueResponse parseFrom(com.google.protobuf.ByteString data,
                                              com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                                                                          throws com.google.protobuf.InvalidProtocolBufferException {
            return PARSER.parseFrom(data, extensionRegistry);
        }

        public static ValueResponse parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
            return PARSER.parseFrom(data);
        }

        public static ValueResponse parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                                                                                       throws com.google.protobuf.InvalidProtocolBufferException {
            return PARSER.parseFrom(data, extensionRegistry);
        }

        public static ValueResponse parseFrom(java.io.InputStream input) throws java.io.IOException {
            return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        }

        public static ValueResponse parseFrom(java.io.InputStream input,
                                              com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                                                                          throws java.io.IOException {
            return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry);
        }

        public static ValueResponse parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException {
            return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
        }

        public static ValueResponse parseDelimitedFrom(java.io.InputStream input,
                                                       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                                                                                   throws java.io.IOException {
            return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input,
                extensionRegistry);
        }

        public static ValueResponse parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException {
            return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        }

        public static ValueResponse parseFrom(com.google.protobuf.CodedInputStream input,
                                              com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                                                                          throws java.io.IOException {
            return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry);
        }

        public Builder newBuilderForType() {
            return newBuilder();
        }

        public static Builder newBuilder() {
            return DEFAULT_INSTANCE.toBuilder();
        }

        public static Builder newBuilder(ValueResponse prototype) {
            return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
        }

        public Builder toBuilder() {
            return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
        }

        @Override
        protected Builder newBuilderForType(BuilderParent parent) {
            Builder builder = new Builder(parent);
            return builder;
        }

        /**
         * Protobuf type {@code jraft.ValueResponse}
         */
        public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
        // @@protoc_insertion_point(builder_implements:jraft.ValueResponse)
                                                                                                         ValueResponseOrBuilder {
            public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
                return CounterOutter.internal_static_jraft_ValueResponse_descriptor;
            }

            protected FieldAccessorTable internalGetFieldAccessorTable() {
                return CounterOutter.internal_static_jraft_ValueResponse_fieldAccessorTable
                    .ensureFieldAccessorsInitialized(ValueResponse.class, Builder.class);
            }

            // Construct using com.alipay.sofa.jraft.example.counter.rpc.CounterOutter.ValueResponse.newBuilder()
            private Builder() {
                maybeForceBuilderInitialization();
            }

            private Builder(BuilderParent parent) {
                super(parent);
                maybeForceBuilderInitialization();
            }

            private void maybeForceBuilderInitialization() {
                if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
                }
            }

            public Builder clear() {
                super.clear();
                value_ = 0L;
                bitField0_ = (bitField0_ & ~0x00000001);
                success_ = false;
                bitField0_ = (bitField0_ & ~0x00000002);
                redirect_ = "";
                bitField0_ = (bitField0_ & ~0x00000004);
                errorMsg_ = "";
                bitField0_ = (bitField0_ & ~0x00000008);
                return this;
            }

            public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
                return CounterOutter.internal_static_jraft_ValueResponse_descriptor;
            }

            public ValueResponse getDefaultInstanceForType() {
                return ValueResponse.getDefaultInstance();
            }

            public ValueResponse build() {
                ValueResponse result = buildPartial();
                if (!result.isInitialized()) {
                    throw newUninitializedMessageException(result);
                }
                return result;
            }

            public ValueResponse buildPartial() {
                ValueResponse result = new ValueResponse(this);
                int from_bitField0_ = bitField0_;
                int to_bitField0_ = 0;
                if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
                    to_bitField0_ |= 0x00000001;
                }
                result.value_ = value_;
                if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
                    to_bitField0_ |= 0x00000002;
                }
                result.success_ = success_;
                if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
                    to_bitField0_ |= 0x00000004;
                }
                result.redirect_ = redirect_;
                if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
                    to_bitField0_ |= 0x00000008;
                }
                result.errorMsg_ = errorMsg_;
                result.bitField0_ = to_bitField0_;
                onBuilt();
                return result;
            }

            public Builder clone() {
                return (Builder) super.clone();
            }

            public Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) {
                return (Builder) super.setField(field, value);
            }

            public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
                return (Builder) super.clearField(field);
            }

            public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
                return (Builder) super.clearOneof(oneof);
            }

            public Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index,
                                            Object value) {
                return (Builder) super.setRepeatedField(field, index, value);
            }

            public Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) {
                return (Builder) super.addRepeatedField(field, value);
            }

            public Builder mergeFrom(com.google.protobuf.Message other) {
                if (other instanceof ValueResponse) {
                    return mergeFrom((ValueResponse) other);
                } else {
                    super.mergeFrom(other);
                    return this;
                }
            }

            public Builder mergeFrom(ValueResponse other) {
                if (other == ValueResponse.getDefaultInstance())
                    return this;
                if (other.hasValue()) {
                    setValue(other.getValue());
                }
                if (other.hasSuccess()) {
                    setSuccess(other.getSuccess());
                }
                if (other.hasRedirect()) {
                    bitField0_ |= 0x00000004;
                    redirect_ = other.redirect_;
                    onChanged();
                }
                if (other.hasErrorMsg()) {
                    bitField0_ |= 0x00000008;
                    errorMsg_ = other.errorMsg_;
                    onChanged();
                }
                this.mergeUnknownFields(other.unknownFields);
                onChanged();
                return this;
            }

            public final boolean isInitialized() {
                if (!hasValue()) {
                    return false;
                }
                if (!hasSuccess()) {
                    return false;
                }
                return true;
            }

            public Builder mergeFrom(com.google.protobuf.CodedInputStream input,
                                     com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                                                                 throws java.io.IOException {
                ValueResponse parsedMessage = null;
                try {
                    parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
                } catch (com.google.protobuf.InvalidProtocolBufferException e) {
                    parsedMessage = (ValueResponse) e.getUnfinishedMessage();
                    throw e.unwrapIOException();
                } finally {
                    if (parsedMessage != null) {
                        mergeFrom(parsedMessage);
                    }
                }
                return this;
            }

            private int  bitField0_;

            private long value_;

            /**
             * <code>required int64 value = 1;</code>
             */
            public boolean hasValue() {
                return ((bitField0_ & 0x00000001) == 0x00000001);
            }

            /**
             * <code>required int64 value = 1;</code>
             */
            public long getValue() {
                return value_;
            }

            /**
             * <code>required int64 value = 1;</code>
             */
            public Builder setValue(long value) {
                bitField0_ |= 0x00000001;
                value_ = value;
                onChanged();
                return this;
            }

            /**
             * <code>required int64 value = 1;</code>
             */
            public Builder clearValue() {
                bitField0_ = (bitField0_ & ~0x00000001);
                value_ = 0L;
                onChanged();
                return this;
            }

            private boolean success_;

            /**
             * <code>required bool success = 2;</code>
             */
            public boolean hasSuccess() {
                return ((bitField0_ & 0x00000002) == 0x00000002);
            }

            /**
             * <code>required bool success = 2;</code>
             */
            public boolean getSuccess() {
                return success_;
            }

            /**
             * <code>required bool success = 2;</code>
             */
            public Builder setSuccess(boolean value) {
                bitField0_ |= 0x00000002;
                success_ = value;
                onChanged();
                return this;
            }

            /**
             * <code>required bool success = 2;</code>
             */
            public Builder clearSuccess() {
                bitField0_ = (bitField0_ & ~0x00000002);
                success_ = false;
                onChanged();
                return this;
            }

            private Object redirect_ = "";

            /**
             * <code>optional string redirect = 3;</code>
             */
            public boolean hasRedirect() {
                return ((bitField0_ & 0x00000004) == 0x00000004);
            }

            /**
             * <code>optional string redirect = 3;</code>
             */
            public String getRedirect() {
                Object ref = redirect_;
                if (!(ref instanceof String)) {
                    com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
                    String s = bs.toStringUtf8();
                    if (bs.isValidUtf8()) {
                        redirect_ = s;
                    }
                    return s;
                } else {
                    return (String) ref;
                }
            }

            /**
             * <code>optional string redirect = 3;</code>
             */
            public com.google.protobuf.ByteString getRedirectBytes() {
                Object ref = redirect_;
                if (ref instanceof String) {
                    com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref);
                    redirect_ = b;
                    return b;
                } else {
                    return (com.google.protobuf.ByteString) ref;
                }
            }

            /**
             * <code>optional string redirect = 3;</code>
             */
            public Builder setRedirect(String value) {
                if (value == null) {
                    throw new NullPointerException();
                }
                bitField0_ |= 0x00000004;
                redirect_ = value;
                onChanged();
                return this;
            }

            /**
             * <code>optional string redirect = 3;</code>
             */
            public Builder clearRedirect() {
                bitField0_ = (bitField0_ & ~0x00000004);
                redirect_ = getDefaultInstance().getRedirect();
                onChanged();
                return this;
            }

            /**
             * <code>optional string redirect = 3;</code>
             */
            public Builder setRedirectBytes(com.google.protobuf.ByteString value) {
                if (value == null) {
                    throw new NullPointerException();
                }
                bitField0_ |= 0x00000004;
                redirect_ = value;
                onChanged();
                return this;
            }

            private Object errorMsg_ = "";

            /**
             * <code>optional string errorMsg = 4;</code>
             */
            public boolean hasErrorMsg() {
                return ((bitField0_ & 0x00000008) == 0x00000008);
            }

            /**
             * <code>optional string errorMsg = 4;</code>
             */
            public String getErrorMsg() {
                Object ref = errorMsg_;
                if (!(ref instanceof String)) {
                    com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
                    String s = bs.toStringUtf8();
                    if (bs.isValidUtf8()) {
                        errorMsg_ = s;
                    }
                    return s;
                } else {
                    return (String) ref;
                }
            }

            /**
             * <code>optional string errorMsg = 4;</code>
             */
            public com.google.protobuf.ByteString getErrorMsgBytes() {
                Object ref = errorMsg_;
                if (ref instanceof String) {
                    com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref);
                    errorMsg_ = b;
                    return b;
                } else {
                    return (com.google.protobuf.ByteString) ref;
                }
            }

            /**
             * <code>optional string errorMsg = 4;</code>
             */
            public Builder setErrorMsg(String value) {
                if (value == null) {
                    throw new NullPointerException();
                }
                bitField0_ |= 0x00000008;
                errorMsg_ = value;
                onChanged();
                return this;
            }

            /**
             * <code>optional string errorMsg = 4;</code>
             */
            public Builder clearErrorMsg() {
                bitField0_ = (bitField0_ & ~0x00000008);
                errorMsg_ = getDefaultInstance().getErrorMsg();
                onChanged();
                return this;
            }

            /**
             * <code>optional string errorMsg = 4;</code>
             */
            public Builder setErrorMsgBytes(com.google.protobuf.ByteString value) {
                if (value == null) {
                    throw new NullPointerException();
                }
                bitField0_ |= 0x00000008;
                errorMsg_ = value;
                onChanged();
                return this;
            }

            public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
                return super.setUnknownFields(unknownFields);
            }

            public final Builder mergeUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
                return super.mergeUnknownFields(unknownFields);
            }

            // @@protoc_insertion_point(builder_scope:jraft.ValueResponse)
        }

        // @@protoc_insertion_point(class_scope:jraft.ValueResponse)
        private static final ValueResponse DEFAULT_INSTANCE;
        static {
            DEFAULT_INSTANCE = new ValueResponse();
        }

        public static ValueResponse getDefaultInstance() {
            return DEFAULT_INSTANCE;
        }

        @Deprecated
        public static final com.google.protobuf.Parser<ValueResponse> PARSER = new com.google.protobuf.AbstractParser<ValueResponse>() {
                                                                                 public ValueResponse parsePartialFrom(com.google.protobuf.CodedInputStream input,
                                                                                                                       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                                                                                                                                                   throws com.google.protobuf.InvalidProtocolBufferException {
                                                                                     return new ValueResponse(input,
                                                                                         extensionRegistry);
                                                                                 }
                                                                             };

        public static com.google.protobuf.Parser<ValueResponse> parser() {
            return PARSER;
        }

        @Override
        public com.google.protobuf.Parser<ValueResponse> getParserForType() {
            return PARSER;
        }

        public ValueResponse getDefaultInstanceForType() {
            return DEFAULT_INSTANCE;
        }

    }

    private static final com.google.protobuf.Descriptors.Descriptor                internal_static_jraft_GetValueRequest_descriptor;
    private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_jraft_GetValueRequest_fieldAccessorTable;
    private static final com.google.protobuf.Descriptors.Descriptor                internal_static_jraft_IncrementAndGetRequest_descriptor;
    private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_jraft_IncrementAndGetRequest_fieldAccessorTable;
    private static final com.google.protobuf.Descriptors.Descriptor                internal_static_jraft_ValueResponse_descriptor;
    private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_jraft_ValueResponse_fieldAccessorTable;

    public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
        return descriptor;
    }

    private static com.google.protobuf.Descriptors.FileDescriptor descriptor;
    static {
        String[] descriptorData = { "\n\rcounter.proto\022\005jraft\"\'\n\017GetValueReques"
                                    + "t\022\024\n\014readOnlySafe\030\001 \002(\010\"\'\n\026IncrementAndG"
                                    + "etRequest\022\r\n\005delta\030\001 \002(\003\"S\n\rValueRespons"
                                    + "e\022\r\n\005value\030\001 \002(\003\022\017\n\007success\030\002 \002(\010\022\020\n\010red"
                                    + "irect\030\003 \001(\t\022\020\n\010errorMsg\030\004 \001(\tB:\n)com.ali"
                                    + "pay.sofa.jraft.example.counter.rpcB\rCoun" + "terOutter" };
        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;
                return null;
            }
        };
        com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(descriptorData,
            new com.google.protobuf.Descriptors.FileDescriptor[] {}, assigner);
        internal_static_jraft_GetValueRequest_descriptor = getDescriptor().getMessageTypes().get(0);
        internal_static_jraft_GetValueRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_jraft_GetValueRequest_descriptor, new String[] { "ReadOnlySafe", });
        internal_static_jraft_IncrementAndGetRequest_descriptor = getDescriptor().getMessageTypes().get(1);
        internal_static_jraft_IncrementAndGetRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_jraft_IncrementAndGetRequest_descriptor, new String[] { "Delta", });
        internal_static_jraft_ValueResponse_descriptor = getDescriptor().getMessageTypes().get(2);
        internal_static_jraft_ValueResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_jraft_ValueResponse_descriptor,
            new String[] { "Value", "Success", "Redirect", "ErrorMsg", });
    }

    // @@protoc_insertion_point(outer_class_scope)
}
