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

package com.google.crypto.tink.proto;

import com.google.protobuf.UnknownFieldSet;
import com.google.protobuf.UninitializedMessageException;
import com.google.protobuf.AbstractParser;
import com.google.protobuf.RuntimeVersion;
import com.google.protobuf.AbstractMessageLite;
import com.google.protobuf.MessageLite;
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.CodedOutputStream;
import com.google.protobuf.ByteString;
import com.google.protobuf.Descriptors;
import com.google.protobuf.Parser;
import com.google.protobuf.GeneratedMessage;

public final class KmsAeadKeyFormat extends GeneratedMessage implements KmsAeadKeyFormatOrBuilder
{
    private static final long serialVersionUID = 0L;
    public static final int KEY_URI_FIELD_NUMBER = 1;
    private volatile Object keyUri_;
    private byte memoizedIsInitialized;
    private static final KmsAeadKeyFormat DEFAULT_INSTANCE;
    private static final Parser<KmsAeadKeyFormat> PARSER;
    
    private KmsAeadKeyFormat(final GeneratedMessage.Builder<?> builder) {
        super(builder);
        this.keyUri_ = "";
        this.memoizedIsInitialized = -1;
    }
    
    private KmsAeadKeyFormat() {
        this.keyUri_ = "";
        this.memoizedIsInitialized = -1;
        this.keyUri_ = "";
    }
    
    public static final Descriptors.Descriptor getDescriptor() {
        return KmsAead.internal_static_google_crypto_tink_KmsAeadKeyFormat_descriptor;
    }
    
    @Override
    protected FieldAccessorTable internalGetFieldAccessorTable() {
        return KmsAead.internal_static_google_crypto_tink_KmsAeadKeyFormat_fieldAccessorTable.ensureFieldAccessorsInitialized(KmsAeadKeyFormat.class, Builder.class);
    }
    
    @Override
    public String getKeyUri() {
        final Object ref = this.keyUri_;
        if (ref instanceof String) {
            return (String)ref;
        }
        final ByteString bs = (ByteString)ref;
        final String s = bs.toStringUtf8();
        return (String)(this.keyUri_ = s);
    }
    
    @Override
    public ByteString getKeyUriBytes() {
        final Object ref = this.keyUri_;
        if (ref instanceof String) {
            final ByteString b = ByteString.copyFromUtf8((String)ref);
            return (ByteString)(this.keyUri_ = 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.keyUri_)) {
            GeneratedMessage.writeString(output, 1, this.keyUri_);
        }
        this.getUnknownFields().writeTo(output);
    }
    
    @Override
    public int getSerializedSize() {
        int size = this.memoizedSize;
        if (size != -1) {
            return size;
        }
        size = 0;
        if (!GeneratedMessage.isStringEmpty(this.keyUri_)) {
            size += GeneratedMessage.computeStringSize(1, this.keyUri_);
        }
        size += this.getUnknownFields().getSerializedSize();
        return this.memoizedSize = size;
    }
    
    @Override
    public boolean equals(final Object obj) {
        if (obj == this) {
            return true;
        }
        if (!(obj instanceof KmsAeadKeyFormat)) {
            return super.equals(obj);
        }
        final KmsAeadKeyFormat other = (KmsAeadKeyFormat)obj;
        return this.getKeyUri().equals(other.getKeyUri()) && 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.getKeyUri().hashCode();
        hash = 29 * hash + this.getUnknownFields().hashCode();
        return this.memoizedHashCode = hash;
    }
    
    public static KmsAeadKeyFormat parseFrom(final ByteBuffer data) throws InvalidProtocolBufferException {
        return KmsAeadKeyFormat.PARSER.parseFrom(data);
    }
    
    public static KmsAeadKeyFormat parseFrom(final ByteBuffer data, final ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException {
        return KmsAeadKeyFormat.PARSER.parseFrom(data, extensionRegistry);
    }
    
    public static KmsAeadKeyFormat parseFrom(final ByteString data) throws InvalidProtocolBufferException {
        return KmsAeadKeyFormat.PARSER.parseFrom(data);
    }
    
    public static KmsAeadKeyFormat parseFrom(final ByteString data, final ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException {
        return KmsAeadKeyFormat.PARSER.parseFrom(data, extensionRegistry);
    }
    
    public static KmsAeadKeyFormat parseFrom(final byte[] data) throws InvalidProtocolBufferException {
        return KmsAeadKeyFormat.PARSER.parseFrom(data);
    }
    
    public static KmsAeadKeyFormat parseFrom(final byte[] data, final ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException {
        return KmsAeadKeyFormat.PARSER.parseFrom(data, extensionRegistry);
    }
    
    public static KmsAeadKeyFormat parseFrom(final InputStream input) throws IOException {
        return GeneratedMessage.parseWithIOException(KmsAeadKeyFormat.PARSER, input);
    }
    
    public static KmsAeadKeyFormat parseFrom(final InputStream input, final ExtensionRegistryLite extensionRegistry) throws IOException {
        return GeneratedMessage.parseWithIOException(KmsAeadKeyFormat.PARSER, input, extensionRegistry);
    }
    
    public static KmsAeadKeyFormat parseDelimitedFrom(final InputStream input) throws IOException {
        return GeneratedMessage.parseDelimitedWithIOException(KmsAeadKeyFormat.PARSER, input);
    }
    
    public static KmsAeadKeyFormat parseDelimitedFrom(final InputStream input, final ExtensionRegistryLite extensionRegistry) throws IOException {
        return GeneratedMessage.parseDelimitedWithIOException(KmsAeadKeyFormat.PARSER, input, extensionRegistry);
    }
    
    public static KmsAeadKeyFormat parseFrom(final CodedInputStream input) throws IOException {
        return GeneratedMessage.parseWithIOException(KmsAeadKeyFormat.PARSER, input);
    }
    
    public static KmsAeadKeyFormat parseFrom(final CodedInputStream input, final ExtensionRegistryLite extensionRegistry) throws IOException {
        return GeneratedMessage.parseWithIOException(KmsAeadKeyFormat.PARSER, input, extensionRegistry);
    }
    
    @Override
    public Builder newBuilderForType() {
        return newBuilder();
    }
    
    public static Builder newBuilder() {
        return KmsAeadKeyFormat.DEFAULT_INSTANCE.toBuilder();
    }
    
    public static Builder newBuilder(final KmsAeadKeyFormat prototype) {
        return KmsAeadKeyFormat.DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }
    
    @Override
    public Builder toBuilder() {
        return (this == KmsAeadKeyFormat.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 KmsAeadKeyFormat getDefaultInstance() {
        return KmsAeadKeyFormat.DEFAULT_INSTANCE;
    }
    
    public static Parser<KmsAeadKeyFormat> parser() {
        return KmsAeadKeyFormat.PARSER;
    }
    
    @Override
    public Parser<KmsAeadKeyFormat> getParserForType() {
        return KmsAeadKeyFormat.PARSER;
    }
    
    @Override
    public KmsAeadKeyFormat getDefaultInstanceForType() {
        return KmsAeadKeyFormat.DEFAULT_INSTANCE;
    }
    
    static {
        RuntimeVersion.validateProtobufGencodeVersion(RuntimeVersion.RuntimeDomain.PUBLIC, 4, 32, 1, "", KmsAeadKeyFormat.class.getName());
        DEFAULT_INSTANCE = new KmsAeadKeyFormat();
        PARSER = new AbstractParser<KmsAeadKeyFormat>() {
            @Override
            public KmsAeadKeyFormat parsePartialFrom(final CodedInputStream input, final ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException {
                final Builder builder = KmsAeadKeyFormat.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 KmsAeadKeyFormatOrBuilder
    {
        private int bitField0_;
        private Object keyUri_;
        
        public static final Descriptors.Descriptor getDescriptor() {
            return KmsAead.internal_static_google_crypto_tink_KmsAeadKeyFormat_descriptor;
        }
        
        @Override
        protected FieldAccessorTable internalGetFieldAccessorTable() {
            return KmsAead.internal_static_google_crypto_tink_KmsAeadKeyFormat_fieldAccessorTable.ensureFieldAccessorsInitialized(KmsAeadKeyFormat.class, Builder.class);
        }
        
        private Builder() {
            this.keyUri_ = "";
        }
        
        private Builder(final BuilderParent parent) {
            super(parent);
            this.keyUri_ = "";
        }
        
        @Override
        public Builder clear() {
            super.clear();
            this.bitField0_ = 0;
            this.keyUri_ = "";
            return this;
        }
        
        @Override
        public Descriptors.Descriptor getDescriptorForType() {
            return KmsAead.internal_static_google_crypto_tink_KmsAeadKeyFormat_descriptor;
        }
        
        @Override
        public KmsAeadKeyFormat getDefaultInstanceForType() {
            return KmsAeadKeyFormat.getDefaultInstance();
        }
        
        @Override
        public KmsAeadKeyFormat build() {
            final KmsAeadKeyFormat result = this.buildPartial();
            if (!result.isInitialized()) {
                throw AbstractMessage.Builder.newUninitializedMessageException(result);
            }
            return result;
        }
        
        @Override
        public KmsAeadKeyFormat buildPartial() {
            final KmsAeadKeyFormat result = new KmsAeadKeyFormat(this, null);
            if (this.bitField0_ != 0) {
                this.buildPartial0(result);
            }
            this.onBuilt();
            return result;
        }
        
        private void buildPartial0(final KmsAeadKeyFormat result) {
            final int from_bitField0_ = this.bitField0_;
            if ((from_bitField0_ & 0x1) != 0x0) {
                result.keyUri_ = this.keyUri_;
            }
        }
        
        @Override
        public Builder mergeFrom(final Message other) {
            if (other instanceof KmsAeadKeyFormat) {
                return this.mergeFrom((KmsAeadKeyFormat)other);
            }
            super.mergeFrom(other);
            return this;
        }
        
        public Builder mergeFrom(final KmsAeadKeyFormat other) {
            if (other == KmsAeadKeyFormat.getDefaultInstance()) {
                return this;
            }
            if (!other.getKeyUri().isEmpty()) {
                this.keyUri_ = other.keyUri_;
                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.keyUri_ = 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 getKeyUri() {
            final Object ref = this.keyUri_;
            if (!(ref instanceof String)) {
                final ByteString bs = (ByteString)ref;
                final String s = bs.toStringUtf8();
                return (String)(this.keyUri_ = s);
            }
            return (String)ref;
        }
        
        @Override
        public ByteString getKeyUriBytes() {
            final Object ref = this.keyUri_;
            if (ref instanceof String) {
                final ByteString b = ByteString.copyFromUtf8((String)ref);
                return (ByteString)(this.keyUri_ = b);
            }
            return (ByteString)ref;
        }
        
        public Builder setKeyUri(final String value) {
            if (value == null) {
                throw new NullPointerException();
            }
            this.keyUri_ = value;
            this.bitField0_ |= 0x1;
            this.onChanged();
            return this;
        }
        
        public Builder clearKeyUri() {
            this.keyUri_ = KmsAeadKeyFormat.getDefaultInstance().getKeyUri();
            this.bitField0_ &= 0xFFFFFFFE;
            this.onChanged();
            return this;
        }
        
        public Builder setKeyUriBytes(final ByteString value) {
            if (value == null) {
                throw new NullPointerException();
            }
            AbstractMessageLite.checkByteStringIsUtf8(value);
            this.keyUri_ = value;
            this.bitField0_ |= 0x1;
            this.onChanged();
            return this;
        }
    }
}
