// 
// Decompiled by Procyon v0.6.0
// 

package com.google.crypto.tink.proto;

import com.google.protobuf.MessageOrBuilder;
import com.google.protobuf.SingleFieldBuilder;
import com.google.protobuf.UnknownFieldSet;
import com.google.protobuf.AbstractMessageLite;
import com.google.protobuf.UninitializedMessageException;
import com.google.protobuf.AbstractParser;
import com.google.protobuf.RuntimeVersion;
import com.google.protobuf.Message;
import com.google.protobuf.AbstractMessage;
import com.google.protobuf.CodedInputStream;
import java.io.InputStream;
import com.google.protobuf.ExtensionRegistryLite;
import com.google.protobuf.InvalidProtocolBufferException;
import java.nio.ByteBuffer;
import java.io.IOException;
import com.google.protobuf.MessageLite;
import com.google.protobuf.CodedOutputStream;
import com.google.protobuf.Descriptors;
import com.google.protobuf.Parser;
import com.google.protobuf.ByteString;
import com.google.protobuf.GeneratedMessage;

public final class JwtRsaSsaPkcs1PublicKey extends GeneratedMessage implements JwtRsaSsaPkcs1PublicKeyOrBuilder
{
    private static final long serialVersionUID = 0L;
    private int bitField0_;
    public static final int VERSION_FIELD_NUMBER = 1;
    private int version_;
    public static final int ALGORITHM_FIELD_NUMBER = 2;
    private int algorithm_;
    public static final int N_FIELD_NUMBER = 3;
    private ByteString n_;
    public static final int E_FIELD_NUMBER = 4;
    private ByteString e_;
    public static final int CUSTOM_KID_FIELD_NUMBER = 5;
    private CustomKid customKid_;
    private byte memoizedIsInitialized;
    private static final JwtRsaSsaPkcs1PublicKey DEFAULT_INSTANCE;
    private static final Parser<JwtRsaSsaPkcs1PublicKey> PARSER;
    
    private JwtRsaSsaPkcs1PublicKey(final GeneratedMessage.Builder<?> builder) {
        super(builder);
        this.version_ = 0;
        this.algorithm_ = 0;
        this.n_ = ByteString.EMPTY;
        this.e_ = ByteString.EMPTY;
        this.memoizedIsInitialized = -1;
    }
    
    private JwtRsaSsaPkcs1PublicKey() {
        this.version_ = 0;
        this.algorithm_ = 0;
        this.n_ = ByteString.EMPTY;
        this.e_ = ByteString.EMPTY;
        this.memoizedIsInitialized = -1;
        this.algorithm_ = 0;
        this.n_ = ByteString.EMPTY;
        this.e_ = ByteString.EMPTY;
    }
    
    public static final Descriptors.Descriptor getDescriptor() {
        return JwtRsaSsaPkcs1.internal_static_google_crypto_tink_JwtRsaSsaPkcs1PublicKey_descriptor;
    }
    
    @Override
    protected FieldAccessorTable internalGetFieldAccessorTable() {
        return JwtRsaSsaPkcs1.internal_static_google_crypto_tink_JwtRsaSsaPkcs1PublicKey_fieldAccessorTable.ensureFieldAccessorsInitialized(JwtRsaSsaPkcs1PublicKey.class, Builder.class);
    }
    
    @Override
    public int getVersion() {
        return this.version_;
    }
    
    @Override
    public int getAlgorithmValue() {
        return this.algorithm_;
    }
    
    @Override
    public JwtRsaSsaPkcs1Algorithm getAlgorithm() {
        final JwtRsaSsaPkcs1Algorithm result = JwtRsaSsaPkcs1Algorithm.forNumber(this.algorithm_);
        return (result == null) ? JwtRsaSsaPkcs1Algorithm.UNRECOGNIZED : result;
    }
    
    @Override
    public ByteString getN() {
        return this.n_;
    }
    
    @Override
    public ByteString getE() {
        return this.e_;
    }
    
    @Override
    public boolean hasCustomKid() {
        return (this.bitField0_ & 0x1) != 0x0;
    }
    
    @Override
    public CustomKid getCustomKid() {
        return (this.customKid_ == null) ? CustomKid.getDefaultInstance() : this.customKid_;
    }
    
    @Override
    public CustomKidOrBuilder getCustomKidOrBuilder() {
        return (this.customKid_ == null) ? CustomKid.getDefaultInstance() : this.customKid_;
    }
    
    @Override
    public final boolean isInitialized() {
        final byte isInitialized = this.memoizedIsInitialized;
        if (isInitialized == 1) {
            return true;
        }
        if (isInitialized == 0) {
            return false;
        }
        this.memoizedIsInitialized = 1;
        return true;
    }
    
    @Override
    public void writeTo(final CodedOutputStream output) throws IOException {
        if (this.version_ != 0) {
            output.writeUInt32(1, this.version_);
        }
        if (this.algorithm_ != JwtRsaSsaPkcs1Algorithm.RS_UNKNOWN.getNumber()) {
            output.writeEnum(2, this.algorithm_);
        }
        if (!this.n_.isEmpty()) {
            output.writeBytes(3, this.n_);
        }
        if (!this.e_.isEmpty()) {
            output.writeBytes(4, this.e_);
        }
        if ((this.bitField0_ & 0x1) != 0x0) {
            output.writeMessage(5, this.getCustomKid());
        }
        this.getUnknownFields().writeTo(output);
    }
    
    @Override
    public int getSerializedSize() {
        int size = this.memoizedSize;
        if (size != -1) {
            return size;
        }
        size = 0;
        if (this.version_ != 0) {
            size += CodedOutputStream.computeUInt32Size(1, this.version_);
        }
        if (this.algorithm_ != JwtRsaSsaPkcs1Algorithm.RS_UNKNOWN.getNumber()) {
            size += CodedOutputStream.computeEnumSize(2, this.algorithm_);
        }
        if (!this.n_.isEmpty()) {
            size += CodedOutputStream.computeBytesSize(3, this.n_);
        }
        if (!this.e_.isEmpty()) {
            size += CodedOutputStream.computeBytesSize(4, this.e_);
        }
        if ((this.bitField0_ & 0x1) != 0x0) {
            size += CodedOutputStream.computeMessageSize(5, this.getCustomKid());
        }
        size += this.getUnknownFields().getSerializedSize();
        return this.memoizedSize = size;
    }
    
    @Override
    public boolean equals(final Object obj) {
        if (obj == this) {
            return true;
        }
        if (!(obj instanceof JwtRsaSsaPkcs1PublicKey)) {
            return super.equals(obj);
        }
        final JwtRsaSsaPkcs1PublicKey other = (JwtRsaSsaPkcs1PublicKey)obj;
        return this.getVersion() == other.getVersion() && this.algorithm_ == other.algorithm_ && this.getN().equals(other.getN()) && this.getE().equals(other.getE()) && this.hasCustomKid() == other.hasCustomKid() && (!this.hasCustomKid() || this.getCustomKid().equals(other.getCustomKid())) && this.getUnknownFields().equals(other.getUnknownFields());
    }
    
    @Override
    public int hashCode() {
        if (this.memoizedHashCode != 0) {
            return this.memoizedHashCode;
        }
        int hash = 41;
        hash = 19 * hash + getDescriptor().hashCode();
        hash = 37 * hash + 1;
        hash = 53 * hash + this.getVersion();
        hash = 37 * hash + 2;
        hash = 53 * hash + this.algorithm_;
        hash = 37 * hash + 3;
        hash = 53 * hash + this.getN().hashCode();
        hash = 37 * hash + 4;
        hash = 53 * hash + this.getE().hashCode();
        if (this.hasCustomKid()) {
            hash = 37 * hash + 5;
            hash = 53 * hash + this.getCustomKid().hashCode();
        }
        hash = 29 * hash + this.getUnknownFields().hashCode();
        return this.memoizedHashCode = hash;
    }
    
    public static JwtRsaSsaPkcs1PublicKey parseFrom(final ByteBuffer data) throws InvalidProtocolBufferException {
        return JwtRsaSsaPkcs1PublicKey.PARSER.parseFrom(data);
    }
    
    public static JwtRsaSsaPkcs1PublicKey parseFrom(final ByteBuffer data, final ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException {
        return JwtRsaSsaPkcs1PublicKey.PARSER.parseFrom(data, extensionRegistry);
    }
    
    public static JwtRsaSsaPkcs1PublicKey parseFrom(final ByteString data) throws InvalidProtocolBufferException {
        return JwtRsaSsaPkcs1PublicKey.PARSER.parseFrom(data);
    }
    
    public static JwtRsaSsaPkcs1PublicKey parseFrom(final ByteString data, final ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException {
        return JwtRsaSsaPkcs1PublicKey.PARSER.parseFrom(data, extensionRegistry);
    }
    
    public static JwtRsaSsaPkcs1PublicKey parseFrom(final byte[] data) throws InvalidProtocolBufferException {
        return JwtRsaSsaPkcs1PublicKey.PARSER.parseFrom(data);
    }
    
    public static JwtRsaSsaPkcs1PublicKey parseFrom(final byte[] data, final ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException {
        return JwtRsaSsaPkcs1PublicKey.PARSER.parseFrom(data, extensionRegistry);
    }
    
    public static JwtRsaSsaPkcs1PublicKey parseFrom(final InputStream input) throws IOException {
        return GeneratedMessage.parseWithIOException(JwtRsaSsaPkcs1PublicKey.PARSER, input);
    }
    
    public static JwtRsaSsaPkcs1PublicKey parseFrom(final InputStream input, final ExtensionRegistryLite extensionRegistry) throws IOException {
        return GeneratedMessage.parseWithIOException(JwtRsaSsaPkcs1PublicKey.PARSER, input, extensionRegistry);
    }
    
    public static JwtRsaSsaPkcs1PublicKey parseDelimitedFrom(final InputStream input) throws IOException {
        return GeneratedMessage.parseDelimitedWithIOException(JwtRsaSsaPkcs1PublicKey.PARSER, input);
    }
    
    public static JwtRsaSsaPkcs1PublicKey parseDelimitedFrom(final InputStream input, final ExtensionRegistryLite extensionRegistry) throws IOException {
        return GeneratedMessage.parseDelimitedWithIOException(JwtRsaSsaPkcs1PublicKey.PARSER, input, extensionRegistry);
    }
    
    public static JwtRsaSsaPkcs1PublicKey parseFrom(final CodedInputStream input) throws IOException {
        return GeneratedMessage.parseWithIOException(JwtRsaSsaPkcs1PublicKey.PARSER, input);
    }
    
    public static JwtRsaSsaPkcs1PublicKey parseFrom(final CodedInputStream input, final ExtensionRegistryLite extensionRegistry) throws IOException {
        return GeneratedMessage.parseWithIOException(JwtRsaSsaPkcs1PublicKey.PARSER, input, extensionRegistry);
    }
    
    @Override
    public Builder newBuilderForType() {
        return newBuilder();
    }
    
    public static Builder newBuilder() {
        return JwtRsaSsaPkcs1PublicKey.DEFAULT_INSTANCE.toBuilder();
    }
    
    public static Builder newBuilder(final JwtRsaSsaPkcs1PublicKey prototype) {
        return JwtRsaSsaPkcs1PublicKey.DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }
    
    @Override
    public Builder toBuilder() {
        return (this == JwtRsaSsaPkcs1PublicKey.DEFAULT_INSTANCE) ? new Builder() : new Builder().mergeFrom(this);
    }
    
    @Override
    protected Builder newBuilderForType(final BuilderParent parent) {
        final Builder builder = new Builder(parent);
        return builder;
    }
    
    public static JwtRsaSsaPkcs1PublicKey getDefaultInstance() {
        return JwtRsaSsaPkcs1PublicKey.DEFAULT_INSTANCE;
    }
    
    public static Parser<JwtRsaSsaPkcs1PublicKey> parser() {
        return JwtRsaSsaPkcs1PublicKey.PARSER;
    }
    
    @Override
    public Parser<JwtRsaSsaPkcs1PublicKey> getParserForType() {
        return JwtRsaSsaPkcs1PublicKey.PARSER;
    }
    
    @Override
    public JwtRsaSsaPkcs1PublicKey getDefaultInstanceForType() {
        return JwtRsaSsaPkcs1PublicKey.DEFAULT_INSTANCE;
    }
    
    static {
        RuntimeVersion.validateProtobufGencodeVersion(RuntimeVersion.RuntimeDomain.PUBLIC, 4, 32, 1, "", JwtRsaSsaPkcs1PublicKey.class.getName());
        DEFAULT_INSTANCE = new JwtRsaSsaPkcs1PublicKey();
        PARSER = new AbstractParser<JwtRsaSsaPkcs1PublicKey>() {
            @Override
            public JwtRsaSsaPkcs1PublicKey parsePartialFrom(final CodedInputStream input, final ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException {
                final Builder builder = JwtRsaSsaPkcs1PublicKey.newBuilder();
                try {
                    builder.mergeFrom(input, extensionRegistry);
                }
                catch (final InvalidProtocolBufferException e) {
                    throw e.setUnfinishedMessage(builder.buildPartial());
                }
                catch (final UninitializedMessageException e2) {
                    throw e2.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
                }
                catch (final IOException e3) {
                    throw new InvalidProtocolBufferException(e3).setUnfinishedMessage(builder.buildPartial());
                }
                return builder.buildPartial();
            }
        };
    }
    
    public static final class CustomKid extends GeneratedMessage implements CustomKidOrBuilder
    {
        private static final long serialVersionUID = 0L;
        public static final int VALUE_FIELD_NUMBER = 1;
        private volatile Object value_;
        private byte memoizedIsInitialized;
        private static final CustomKid DEFAULT_INSTANCE;
        private static final Parser<CustomKid> PARSER;
        
        private CustomKid(final GeneratedMessage.Builder<?> builder) {
            super(builder);
            this.value_ = "";
            this.memoizedIsInitialized = -1;
        }
        
        private CustomKid() {
            this.value_ = "";
            this.memoizedIsInitialized = -1;
            this.value_ = "";
        }
        
        public static final Descriptors.Descriptor getDescriptor() {
            return JwtRsaSsaPkcs1.internal_static_google_crypto_tink_JwtRsaSsaPkcs1PublicKey_CustomKid_descriptor;
        }
        
        @Override
        protected FieldAccessorTable internalGetFieldAccessorTable() {
            return JwtRsaSsaPkcs1.internal_static_google_crypto_tink_JwtRsaSsaPkcs1PublicKey_CustomKid_fieldAccessorTable.ensureFieldAccessorsInitialized(CustomKid.class, Builder.class);
        }
        
        @Override
        public String getValue() {
            final Object ref = this.value_;
            if (ref instanceof String) {
                return (String)ref;
            }
            final ByteString bs = (ByteString)ref;
            final String s = bs.toStringUtf8();
            return (String)(this.value_ = s);
        }
        
        @Override
        public ByteString getValueBytes() {
            final Object ref = this.value_;
            if (ref instanceof String) {
                final ByteString b = ByteString.copyFromUtf8((String)ref);
                return (ByteString)(this.value_ = b);
            }
            return (ByteString)ref;
        }
        
        @Override
        public final boolean isInitialized() {
            final byte isInitialized = this.memoizedIsInitialized;
            if (isInitialized == 1) {
                return true;
            }
            if (isInitialized == 0) {
                return false;
            }
            this.memoizedIsInitialized = 1;
            return true;
        }
        
        @Override
        public void writeTo(final CodedOutputStream output) throws IOException {
            if (!GeneratedMessage.isStringEmpty(this.value_)) {
                GeneratedMessage.writeString(output, 1, this.value_);
            }
            this.getUnknownFields().writeTo(output);
        }
        
        @Override
        public int getSerializedSize() {
            int size = this.memoizedSize;
            if (size != -1) {
                return size;
            }
            size = 0;
            if (!GeneratedMessage.isStringEmpty(this.value_)) {
                size += GeneratedMessage.computeStringSize(1, this.value_);
            }
            size += this.getUnknownFields().getSerializedSize();
            return this.memoizedSize = size;
        }
        
        @Override
        public boolean equals(final Object obj) {
            if (obj == this) {
                return true;
            }
            if (!(obj instanceof CustomKid)) {
                return super.equals(obj);
            }
            final CustomKid other = (CustomKid)obj;
            return this.getValue().equals(other.getValue()) && this.getUnknownFields().equals(other.getUnknownFields());
        }
        
        @Override
        public int hashCode() {
            if (this.memoizedHashCode != 0) {
                return this.memoizedHashCode;
            }
            int hash = 41;
            hash = 19 * hash + getDescriptor().hashCode();
            hash = 37 * hash + 1;
            hash = 53 * hash + this.getValue().hashCode();
            hash = 29 * hash + this.getUnknownFields().hashCode();
            return this.memoizedHashCode = hash;
        }
        
        public static CustomKid parseFrom(final ByteBuffer data) throws InvalidProtocolBufferException {
            return CustomKid.PARSER.parseFrom(data);
        }
        
        public static CustomKid parseFrom(final ByteBuffer data, final ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException {
            return CustomKid.PARSER.parseFrom(data, extensionRegistry);
        }
        
        public static CustomKid parseFrom(final ByteString data) throws InvalidProtocolBufferException {
            return CustomKid.PARSER.parseFrom(data);
        }
        
        public static CustomKid parseFrom(final ByteString data, final ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException {
            return CustomKid.PARSER.parseFrom(data, extensionRegistry);
        }
        
        public static CustomKid parseFrom(final byte[] data) throws InvalidProtocolBufferException {
            return CustomKid.PARSER.parseFrom(data);
        }
        
        public static CustomKid parseFrom(final byte[] data, final ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException {
            return CustomKid.PARSER.parseFrom(data, extensionRegistry);
        }
        
        public static CustomKid parseFrom(final InputStream input) throws IOException {
            return GeneratedMessage.parseWithIOException(CustomKid.PARSER, input);
        }
        
        public static CustomKid parseFrom(final InputStream input, final ExtensionRegistryLite extensionRegistry) throws IOException {
            return GeneratedMessage.parseWithIOException(CustomKid.PARSER, input, extensionRegistry);
        }
        
        public static CustomKid parseDelimitedFrom(final InputStream input) throws IOException {
            return GeneratedMessage.parseDelimitedWithIOException(CustomKid.PARSER, input);
        }
        
        public static CustomKid parseDelimitedFrom(final InputStream input, final ExtensionRegistryLite extensionRegistry) throws IOException {
            return GeneratedMessage.parseDelimitedWithIOException(CustomKid.PARSER, input, extensionRegistry);
        }
        
        public static CustomKid parseFrom(final CodedInputStream input) throws IOException {
            return GeneratedMessage.parseWithIOException(CustomKid.PARSER, input);
        }
        
        public static CustomKid parseFrom(final CodedInputStream input, final ExtensionRegistryLite extensionRegistry) throws IOException {
            return GeneratedMessage.parseWithIOException(CustomKid.PARSER, input, extensionRegistry);
        }
        
        @Override
        public Builder newBuilderForType() {
            return newBuilder();
        }
        
        public static Builder newBuilder() {
            return CustomKid.DEFAULT_INSTANCE.toBuilder();
        }
        
        public static Builder newBuilder(final CustomKid prototype) {
            return CustomKid.DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
        }
        
        @Override
        public Builder toBuilder() {
            return (this == CustomKid.DEFAULT_INSTANCE) ? new Builder() : new Builder().mergeFrom(this);
        }
        
        @Override
        protected Builder newBuilderForType(final BuilderParent parent) {
            final Builder builder = new Builder(parent);
            return builder;
        }
        
        public static CustomKid getDefaultInstance() {
            return CustomKid.DEFAULT_INSTANCE;
        }
        
        public static Parser<CustomKid> parser() {
            return CustomKid.PARSER;
        }
        
        @Override
        public Parser<CustomKid> getParserForType() {
            return CustomKid.PARSER;
        }
        
        @Override
        public CustomKid getDefaultInstanceForType() {
            return CustomKid.DEFAULT_INSTANCE;
        }
        
        static {
            RuntimeVersion.validateProtobufGencodeVersion(RuntimeVersion.RuntimeDomain.PUBLIC, 4, 32, 1, "", CustomKid.class.getName());
            DEFAULT_INSTANCE = new CustomKid();
            PARSER = new AbstractParser<CustomKid>() {
                @Override
                public CustomKid parsePartialFrom(final CodedInputStream input, final ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException {
                    final Builder builder = CustomKid.newBuilder();
                    try {
                        builder.mergeFrom(input, extensionRegistry);
                    }
                    catch (final InvalidProtocolBufferException e) {
                        throw e.setUnfinishedMessage(builder.buildPartial());
                    }
                    catch (final UninitializedMessageException e2) {
                        throw e2.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
                    }
                    catch (final IOException e3) {
                        throw new InvalidProtocolBufferException(e3).setUnfinishedMessage(builder.buildPartial());
                    }
                    return builder.buildPartial();
                }
            };
        }
        
        public static final class Builder extends GeneratedMessage.Builder<Builder> implements CustomKidOrBuilder
        {
            private int bitField0_;
            private Object value_;
            
            public static final Descriptors.Descriptor getDescriptor() {
                return JwtRsaSsaPkcs1.internal_static_google_crypto_tink_JwtRsaSsaPkcs1PublicKey_CustomKid_descriptor;
            }
            
            @Override
            protected FieldAccessorTable internalGetFieldAccessorTable() {
                return JwtRsaSsaPkcs1.internal_static_google_crypto_tink_JwtRsaSsaPkcs1PublicKey_CustomKid_fieldAccessorTable.ensureFieldAccessorsInitialized(CustomKid.class, Builder.class);
            }
            
            private Builder() {
                this.value_ = "";
            }
            
            private Builder(final BuilderParent parent) {
                super(parent);
                this.value_ = "";
            }
            
            @Override
            public Builder clear() {
                super.clear();
                this.bitField0_ = 0;
                this.value_ = "";
                return this;
            }
            
            @Override
            public Descriptors.Descriptor getDescriptorForType() {
                return JwtRsaSsaPkcs1.internal_static_google_crypto_tink_JwtRsaSsaPkcs1PublicKey_CustomKid_descriptor;
            }
            
            @Override
            public CustomKid getDefaultInstanceForType() {
                return CustomKid.getDefaultInstance();
            }
            
            @Override
            public CustomKid build() {
                final CustomKid result = this.buildPartial();
                if (!result.isInitialized()) {
                    throw AbstractMessage.Builder.newUninitializedMessageException(result);
                }
                return result;
            }
            
            @Override
            public CustomKid buildPartial() {
                final CustomKid result = new CustomKid((GeneratedMessage.Builder)this);
                if (this.bitField0_ != 0) {
                    this.buildPartial0(result);
                }
                this.onBuilt();
                return result;
            }
            
            private void buildPartial0(final CustomKid result) {
                final int from_bitField0_ = this.bitField0_;
                if ((from_bitField0_ & 0x1) != 0x0) {
                    result.value_ = this.value_;
                }
            }
            
            @Override
            public Builder mergeFrom(final Message other) {
                if (other instanceof CustomKid) {
                    return this.mergeFrom((CustomKid)other);
                }
                super.mergeFrom(other);
                return this;
            }
            
            public Builder mergeFrom(final CustomKid other) {
                if (other == CustomKid.getDefaultInstance()) {
                    return this;
                }
                if (!other.getValue().isEmpty()) {
                    this.value_ = other.value_;
                    this.bitField0_ |= 0x1;
                    this.onChanged();
                }
                this.mergeUnknownFields(other.getUnknownFields());
                this.onChanged();
                return this;
            }
            
            @Override
            public final boolean isInitialized() {
                return true;
            }
            
            @Override
            public Builder mergeFrom(final CodedInputStream input, final ExtensionRegistryLite extensionRegistry) throws IOException {
                if (extensionRegistry == null) {
                    throw new NullPointerException();
                }
                try {
                    boolean done = false;
                    while (!done) {
                        final int tag = input.readTag();
                        switch (tag) {
                            case 0: {
                                done = true;
                                continue;
                            }
                            case 10: {
                                this.value_ = input.readStringRequireUtf8();
                                this.bitField0_ |= 0x1;
                                continue;
                            }
                            default: {
                                if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                                    done = true;
                                    continue;
                                }
                                continue;
                            }
                        }
                    }
                }
                catch (final InvalidProtocolBufferException e) {
                    throw e.unwrapIOException();
                }
                finally {
                    this.onChanged();
                }
                return this;
            }
            
            @Override
            public String getValue() {
                final Object ref = this.value_;
                if (!(ref instanceof String)) {
                    final ByteString bs = (ByteString)ref;
                    final String s = bs.toStringUtf8();
                    return (String)(this.value_ = s);
                }
                return (String)ref;
            }
            
            @Override
            public ByteString getValueBytes() {
                final Object ref = this.value_;
                if (ref instanceof String) {
                    final ByteString b = ByteString.copyFromUtf8((String)ref);
                    return (ByteString)(this.value_ = b);
                }
                return (ByteString)ref;
            }
            
            public Builder setValue(final String value) {
                if (value == null) {
                    throw new NullPointerException();
                }
                this.value_ = value;
                this.bitField0_ |= 0x1;
                this.onChanged();
                return this;
            }
            
            public Builder clearValue() {
                this.value_ = CustomKid.getDefaultInstance().getValue();
                this.bitField0_ &= 0xFFFFFFFE;
                this.onChanged();
                return this;
            }
            
            public Builder setValueBytes(final ByteString value) {
                if (value == null) {
                    throw new NullPointerException();
                }
                AbstractMessageLite.checkByteStringIsUtf8(value);
                this.value_ = value;
                this.bitField0_ |= 0x1;
                this.onChanged();
                return this;
            }
        }
    }
    
    public static final class Builder extends GeneratedMessage.Builder<Builder> implements JwtRsaSsaPkcs1PublicKeyOrBuilder
    {
        private int bitField0_;
        private int version_;
        private int algorithm_;
        private ByteString n_;
        private ByteString e_;
        private CustomKid customKid_;
        private SingleFieldBuilder<CustomKid, CustomKid.Builder, CustomKidOrBuilder> customKidBuilder_;
        
        public static final Descriptors.Descriptor getDescriptor() {
            return JwtRsaSsaPkcs1.internal_static_google_crypto_tink_JwtRsaSsaPkcs1PublicKey_descriptor;
        }
        
        @Override
        protected FieldAccessorTable internalGetFieldAccessorTable() {
            return JwtRsaSsaPkcs1.internal_static_google_crypto_tink_JwtRsaSsaPkcs1PublicKey_fieldAccessorTable.ensureFieldAccessorsInitialized(JwtRsaSsaPkcs1PublicKey.class, Builder.class);
        }
        
        private Builder() {
            this.algorithm_ = 0;
            this.n_ = ByteString.EMPTY;
            this.e_ = ByteString.EMPTY;
            this.maybeForceBuilderInitialization();
        }
        
        private Builder(final BuilderParent parent) {
            super(parent);
            this.algorithm_ = 0;
            this.n_ = ByteString.EMPTY;
            this.e_ = ByteString.EMPTY;
            this.maybeForceBuilderInitialization();
        }
        
        private void maybeForceBuilderInitialization() {
            if (JwtRsaSsaPkcs1PublicKey.alwaysUseFieldBuilders) {
                this.internalGetCustomKidFieldBuilder();
            }
        }
        
        @Override
        public Builder clear() {
            super.clear();
            this.bitField0_ = 0;
            this.version_ = 0;
            this.algorithm_ = 0;
            this.n_ = ByteString.EMPTY;
            this.e_ = ByteString.EMPTY;
            this.customKid_ = null;
            if (this.customKidBuilder_ != null) {
                this.customKidBuilder_.dispose();
                this.customKidBuilder_ = null;
            }
            return this;
        }
        
        @Override
        public Descriptors.Descriptor getDescriptorForType() {
            return JwtRsaSsaPkcs1.internal_static_google_crypto_tink_JwtRsaSsaPkcs1PublicKey_descriptor;
        }
        
        @Override
        public JwtRsaSsaPkcs1PublicKey getDefaultInstanceForType() {
            return JwtRsaSsaPkcs1PublicKey.getDefaultInstance();
        }
        
        @Override
        public JwtRsaSsaPkcs1PublicKey build() {
            final JwtRsaSsaPkcs1PublicKey result = this.buildPartial();
            if (!result.isInitialized()) {
                throw AbstractMessage.Builder.newUninitializedMessageException(result);
            }
            return result;
        }
        
        @Override
        public JwtRsaSsaPkcs1PublicKey buildPartial() {
            final JwtRsaSsaPkcs1PublicKey result = new JwtRsaSsaPkcs1PublicKey(this, null);
            if (this.bitField0_ != 0) {
                this.buildPartial0(result);
            }
            this.onBuilt();
            return result;
        }
        
        private void buildPartial0(final JwtRsaSsaPkcs1PublicKey result) {
            final int from_bitField0_ = this.bitField0_;
            if ((from_bitField0_ & 0x1) != 0x0) {
                result.version_ = this.version_;
            }
            if ((from_bitField0_ & 0x2) != 0x0) {
                result.algorithm_ = this.algorithm_;
            }
            if ((from_bitField0_ & 0x4) != 0x0) {
                result.n_ = this.n_;
            }
            if ((from_bitField0_ & 0x8) != 0x0) {
                result.e_ = this.e_;
            }
            int to_bitField0_ = 0;
            if ((from_bitField0_ & 0x10) != 0x0) {
                result.customKid_ = ((this.customKidBuilder_ == null) ? this.customKid_ : this.customKidBuilder_.build());
                to_bitField0_ |= 0x1;
            }
            result.bitField0_ |= to_bitField0_;
        }
        
        @Override
        public Builder mergeFrom(final Message other) {
            if (other instanceof JwtRsaSsaPkcs1PublicKey) {
                return this.mergeFrom((JwtRsaSsaPkcs1PublicKey)other);
            }
            super.mergeFrom(other);
            return this;
        }
        
        public Builder mergeFrom(final JwtRsaSsaPkcs1PublicKey other) {
            if (other == JwtRsaSsaPkcs1PublicKey.getDefaultInstance()) {
                return this;
            }
            if (other.getVersion() != 0) {
                this.setVersion(other.getVersion());
            }
            if (other.algorithm_ != 0) {
                this.setAlgorithmValue(other.getAlgorithmValue());
            }
            if (!other.getN().isEmpty()) {
                this.setN(other.getN());
            }
            if (!other.getE().isEmpty()) {
                this.setE(other.getE());
            }
            if (other.hasCustomKid()) {
                this.mergeCustomKid(other.getCustomKid());
            }
            this.mergeUnknownFields(other.getUnknownFields());
            this.onChanged();
            return this;
        }
        
        @Override
        public final boolean isInitialized() {
            return true;
        }
        
        @Override
        public Builder mergeFrom(final CodedInputStream input, final ExtensionRegistryLite extensionRegistry) throws IOException {
            if (extensionRegistry == null) {
                throw new NullPointerException();
            }
            try {
                boolean done = false;
                while (!done) {
                    final int tag = input.readTag();
                    switch (tag) {
                        case 0: {
                            done = true;
                            continue;
                        }
                        case 8: {
                            this.version_ = input.readUInt32();
                            this.bitField0_ |= 0x1;
                            continue;
                        }
                        case 16: {
                            this.algorithm_ = input.readEnum();
                            this.bitField0_ |= 0x2;
                            continue;
                        }
                        case 26: {
                            this.n_ = input.readBytes();
                            this.bitField0_ |= 0x4;
                            continue;
                        }
                        case 34: {
                            this.e_ = input.readBytes();
                            this.bitField0_ |= 0x8;
                            continue;
                        }
                        case 42: {
                            input.readMessage(this.internalGetCustomKidFieldBuilder().getBuilder(), extensionRegistry);
                            this.bitField0_ |= 0x10;
                            continue;
                        }
                        default: {
                            if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                                done = true;
                                continue;
                            }
                            continue;
                        }
                    }
                }
            }
            catch (final InvalidProtocolBufferException e) {
                throw e.unwrapIOException();
            }
            finally {
                this.onChanged();
            }
            return this;
        }
        
        @Override
        public int getVersion() {
            return this.version_;
        }
        
        public Builder setVersion(final int value) {
            this.version_ = value;
            this.bitField0_ |= 0x1;
            this.onChanged();
            return this;
        }
        
        public Builder clearVersion() {
            this.bitField0_ &= 0xFFFFFFFE;
            this.version_ = 0;
            this.onChanged();
            return this;
        }
        
        @Override
        public int getAlgorithmValue() {
            return this.algorithm_;
        }
        
        public Builder setAlgorithmValue(final int value) {
            this.algorithm_ = value;
            this.bitField0_ |= 0x2;
            this.onChanged();
            return this;
        }
        
        @Override
        public JwtRsaSsaPkcs1Algorithm getAlgorithm() {
            final JwtRsaSsaPkcs1Algorithm result = JwtRsaSsaPkcs1Algorithm.forNumber(this.algorithm_);
            return (result == null) ? JwtRsaSsaPkcs1Algorithm.UNRECOGNIZED : result;
        }
        
        public Builder setAlgorithm(final JwtRsaSsaPkcs1Algorithm value) {
            if (value == null) {
                throw new NullPointerException();
            }
            this.bitField0_ |= 0x2;
            this.algorithm_ = value.getNumber();
            this.onChanged();
            return this;
        }
        
        public Builder clearAlgorithm() {
            this.bitField0_ &= 0xFFFFFFFD;
            this.algorithm_ = 0;
            this.onChanged();
            return this;
        }
        
        @Override
        public ByteString getN() {
            return this.n_;
        }
        
        public Builder setN(final ByteString value) {
            if (value == null) {
                throw new NullPointerException();
            }
            this.n_ = value;
            this.bitField0_ |= 0x4;
            this.onChanged();
            return this;
        }
        
        public Builder clearN() {
            this.bitField0_ &= 0xFFFFFFFB;
            this.n_ = JwtRsaSsaPkcs1PublicKey.getDefaultInstance().getN();
            this.onChanged();
            return this;
        }
        
        @Override
        public ByteString getE() {
            return this.e_;
        }
        
        public Builder setE(final ByteString value) {
            if (value == null) {
                throw new NullPointerException();
            }
            this.e_ = value;
            this.bitField0_ |= 0x8;
            this.onChanged();
            return this;
        }
        
        public Builder clearE() {
            this.bitField0_ &= 0xFFFFFFF7;
            this.e_ = JwtRsaSsaPkcs1PublicKey.getDefaultInstance().getE();
            this.onChanged();
            return this;
        }
        
        @Override
        public boolean hasCustomKid() {
            return (this.bitField0_ & 0x10) != 0x0;
        }
        
        @Override
        public CustomKid getCustomKid() {
            if (this.customKidBuilder_ == null) {
                return (this.customKid_ == null) ? CustomKid.getDefaultInstance() : this.customKid_;
            }
            return this.customKidBuilder_.getMessage();
        }
        
        public Builder setCustomKid(final CustomKid value) {
            if (this.customKidBuilder_ == null) {
                if (value == null) {
                    throw new NullPointerException();
                }
                this.customKid_ = value;
            }
            else {
                this.customKidBuilder_.setMessage(value);
            }
            this.bitField0_ |= 0x10;
            this.onChanged();
            return this;
        }
        
        public Builder setCustomKid(final CustomKid.Builder builderForValue) {
            if (this.customKidBuilder_ == null) {
                this.customKid_ = builderForValue.build();
            }
            else {
                this.customKidBuilder_.setMessage(builderForValue.build());
            }
            this.bitField0_ |= 0x10;
            this.onChanged();
            return this;
        }
        
        public Builder mergeCustomKid(final CustomKid value) {
            if (this.customKidBuilder_ == null) {
                if ((this.bitField0_ & 0x10) != 0x0 && this.customKid_ != null && this.customKid_ != CustomKid.getDefaultInstance()) {
                    this.getCustomKidBuilder().mergeFrom(value);
                }
                else {
                    this.customKid_ = value;
                }
            }
            else {
                this.customKidBuilder_.mergeFrom(value);
            }
            if (this.customKid_ != null) {
                this.bitField0_ |= 0x10;
                this.onChanged();
            }
            return this;
        }
        
        public Builder clearCustomKid() {
            this.bitField0_ &= 0xFFFFFFEF;
            this.customKid_ = null;
            if (this.customKidBuilder_ != null) {
                this.customKidBuilder_.dispose();
                this.customKidBuilder_ = null;
            }
            this.onChanged();
            return this;
        }
        
        public CustomKid.Builder getCustomKidBuilder() {
            this.bitField0_ |= 0x10;
            this.onChanged();
            return this.internalGetCustomKidFieldBuilder().getBuilder();
        }
        
        @Override
        public CustomKidOrBuilder getCustomKidOrBuilder() {
            if (this.customKidBuilder_ != null) {
                return this.customKidBuilder_.getMessageOrBuilder();
            }
            return (this.customKid_ == null) ? CustomKid.getDefaultInstance() : this.customKid_;
        }
        
        private SingleFieldBuilder<CustomKid, CustomKid.Builder, CustomKidOrBuilder> internalGetCustomKidFieldBuilder() {
            if (this.customKidBuilder_ == null) {
                this.customKidBuilder_ = new SingleFieldBuilder<CustomKid, CustomKid.Builder, CustomKidOrBuilder>(this.getCustomKid(), this.getParentForChildren(), this.isClean());
                this.customKid_ = null;
            }
            return this.customKidBuilder_;
        }
    }
    
    public interface CustomKidOrBuilder extends MessageOrBuilder
    {
        String getValue();
        
        ByteString getValueBytes();
    }
}
