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

package com.google.crypto.tink.proto;

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

public final class ChaCha20Poly1305KeyFormat extends GeneratedMessage implements ChaCha20Poly1305KeyFormatOrBuilder
{
    private static final long serialVersionUID = 0L;
    private byte memoizedIsInitialized;
    private static final ChaCha20Poly1305KeyFormat DEFAULT_INSTANCE;
    private static final Parser<ChaCha20Poly1305KeyFormat> PARSER;
    
    private ChaCha20Poly1305KeyFormat(final GeneratedMessage.Builder<?> builder) {
        super(builder);
        this.memoizedIsInitialized = -1;
    }
    
    private ChaCha20Poly1305KeyFormat() {
        this.memoizedIsInitialized = -1;
    }
    
    public static final Descriptors.Descriptor getDescriptor() {
        return Chacha20Poly1305.internal_static_google_crypto_tink_ChaCha20Poly1305KeyFormat_descriptor;
    }
    
    @Override
    protected FieldAccessorTable internalGetFieldAccessorTable() {
        return Chacha20Poly1305.internal_static_google_crypto_tink_ChaCha20Poly1305KeyFormat_fieldAccessorTable.ensureFieldAccessorsInitialized(ChaCha20Poly1305KeyFormat.class, Builder.class);
    }
    
    @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 {
        this.getUnknownFields().writeTo(output);
    }
    
    @Override
    public int getSerializedSize() {
        int size = this.memoizedSize;
        if (size != -1) {
            return size;
        }
        size = 0;
        size += this.getUnknownFields().getSerializedSize();
        return this.memoizedSize = size;
    }
    
    @Override
    public boolean equals(final Object obj) {
        if (obj == this) {
            return true;
        }
        if (!(obj instanceof ChaCha20Poly1305KeyFormat)) {
            return super.equals(obj);
        }
        final ChaCha20Poly1305KeyFormat other = (ChaCha20Poly1305KeyFormat)obj;
        return 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 = 29 * hash + this.getUnknownFields().hashCode();
        return this.memoizedHashCode = hash;
    }
    
    public static ChaCha20Poly1305KeyFormat parseFrom(final ByteBuffer data) throws InvalidProtocolBufferException {
        return ChaCha20Poly1305KeyFormat.PARSER.parseFrom(data);
    }
    
    public static ChaCha20Poly1305KeyFormat parseFrom(final ByteBuffer data, final ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException {
        return ChaCha20Poly1305KeyFormat.PARSER.parseFrom(data, extensionRegistry);
    }
    
    public static ChaCha20Poly1305KeyFormat parseFrom(final ByteString data) throws InvalidProtocolBufferException {
        return ChaCha20Poly1305KeyFormat.PARSER.parseFrom(data);
    }
    
    public static ChaCha20Poly1305KeyFormat parseFrom(final ByteString data, final ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException {
        return ChaCha20Poly1305KeyFormat.PARSER.parseFrom(data, extensionRegistry);
    }
    
    public static ChaCha20Poly1305KeyFormat parseFrom(final byte[] data) throws InvalidProtocolBufferException {
        return ChaCha20Poly1305KeyFormat.PARSER.parseFrom(data);
    }
    
    public static ChaCha20Poly1305KeyFormat parseFrom(final byte[] data, final ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException {
        return ChaCha20Poly1305KeyFormat.PARSER.parseFrom(data, extensionRegistry);
    }
    
    public static ChaCha20Poly1305KeyFormat parseFrom(final InputStream input) throws IOException {
        return GeneratedMessage.parseWithIOException(ChaCha20Poly1305KeyFormat.PARSER, input);
    }
    
    public static ChaCha20Poly1305KeyFormat parseFrom(final InputStream input, final ExtensionRegistryLite extensionRegistry) throws IOException {
        return GeneratedMessage.parseWithIOException(ChaCha20Poly1305KeyFormat.PARSER, input, extensionRegistry);
    }
    
    public static ChaCha20Poly1305KeyFormat parseDelimitedFrom(final InputStream input) throws IOException {
        return GeneratedMessage.parseDelimitedWithIOException(ChaCha20Poly1305KeyFormat.PARSER, input);
    }
    
    public static ChaCha20Poly1305KeyFormat parseDelimitedFrom(final InputStream input, final ExtensionRegistryLite extensionRegistry) throws IOException {
        return GeneratedMessage.parseDelimitedWithIOException(ChaCha20Poly1305KeyFormat.PARSER, input, extensionRegistry);
    }
    
    public static ChaCha20Poly1305KeyFormat parseFrom(final CodedInputStream input) throws IOException {
        return GeneratedMessage.parseWithIOException(ChaCha20Poly1305KeyFormat.PARSER, input);
    }
    
    public static ChaCha20Poly1305KeyFormat parseFrom(final CodedInputStream input, final ExtensionRegistryLite extensionRegistry) throws IOException {
        return GeneratedMessage.parseWithIOException(ChaCha20Poly1305KeyFormat.PARSER, input, extensionRegistry);
    }
    
    @Override
    public Builder newBuilderForType() {
        return newBuilder();
    }
    
    public static Builder newBuilder() {
        return ChaCha20Poly1305KeyFormat.DEFAULT_INSTANCE.toBuilder();
    }
    
    public static Builder newBuilder(final ChaCha20Poly1305KeyFormat prototype) {
        return ChaCha20Poly1305KeyFormat.DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }
    
    @Override
    public Builder toBuilder() {
        return (this == ChaCha20Poly1305KeyFormat.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 ChaCha20Poly1305KeyFormat getDefaultInstance() {
        return ChaCha20Poly1305KeyFormat.DEFAULT_INSTANCE;
    }
    
    public static Parser<ChaCha20Poly1305KeyFormat> parser() {
        return ChaCha20Poly1305KeyFormat.PARSER;
    }
    
    @Override
    public Parser<ChaCha20Poly1305KeyFormat> getParserForType() {
        return ChaCha20Poly1305KeyFormat.PARSER;
    }
    
    @Override
    public ChaCha20Poly1305KeyFormat getDefaultInstanceForType() {
        return ChaCha20Poly1305KeyFormat.DEFAULT_INSTANCE;
    }
    
    static {
        RuntimeVersion.validateProtobufGencodeVersion(RuntimeVersion.RuntimeDomain.PUBLIC, 4, 32, 1, "", ChaCha20Poly1305KeyFormat.class.getName());
        DEFAULT_INSTANCE = new ChaCha20Poly1305KeyFormat();
        PARSER = new AbstractParser<ChaCha20Poly1305KeyFormat>() {
            @Override
            public ChaCha20Poly1305KeyFormat parsePartialFrom(final CodedInputStream input, final ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException {
                final Builder builder = ChaCha20Poly1305KeyFormat.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 ChaCha20Poly1305KeyFormatOrBuilder
    {
        public static final Descriptors.Descriptor getDescriptor() {
            return Chacha20Poly1305.internal_static_google_crypto_tink_ChaCha20Poly1305KeyFormat_descriptor;
        }
        
        @Override
        protected FieldAccessorTable internalGetFieldAccessorTable() {
            return Chacha20Poly1305.internal_static_google_crypto_tink_ChaCha20Poly1305KeyFormat_fieldAccessorTable.ensureFieldAccessorsInitialized(ChaCha20Poly1305KeyFormat.class, Builder.class);
        }
        
        private Builder() {
        }
        
        private Builder(final BuilderParent parent) {
            super(parent);
        }
        
        @Override
        public Builder clear() {
            super.clear();
            return this;
        }
        
        @Override
        public Descriptors.Descriptor getDescriptorForType() {
            return Chacha20Poly1305.internal_static_google_crypto_tink_ChaCha20Poly1305KeyFormat_descriptor;
        }
        
        @Override
        public ChaCha20Poly1305KeyFormat getDefaultInstanceForType() {
            return ChaCha20Poly1305KeyFormat.getDefaultInstance();
        }
        
        @Override
        public ChaCha20Poly1305KeyFormat build() {
            final ChaCha20Poly1305KeyFormat result = this.buildPartial();
            if (!result.isInitialized()) {
                throw AbstractMessage.Builder.newUninitializedMessageException(result);
            }
            return result;
        }
        
        @Override
        public ChaCha20Poly1305KeyFormat buildPartial() {
            final ChaCha20Poly1305KeyFormat result = new ChaCha20Poly1305KeyFormat(this, null);
            this.onBuilt();
            return result;
        }
        
        @Override
        public Builder mergeFrom(final Message other) {
            if (other instanceof ChaCha20Poly1305KeyFormat) {
                return this.mergeFrom((ChaCha20Poly1305KeyFormat)other);
            }
            super.mergeFrom(other);
            return this;
        }
        
        public Builder mergeFrom(final ChaCha20Poly1305KeyFormat other) {
            if (other == ChaCha20Poly1305KeyFormat.getDefaultInstance()) {
                return this;
            }
            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;
                        }
                        default: {
                            if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                                done = true;
                                continue;
                            }
                            continue;
                        }
                    }
                }
            }
            catch (final InvalidProtocolBufferException e) {
                throw e.unwrapIOException();
            }
            finally {
                this.onChanged();
            }
            return this;
        }
    }
}
