package nano;

import com.google.protobuf.nano.CodedInputByteBufferNano;
import com.google.protobuf.nano.CodedOutputByteBufferNano;
import com.google.protobuf.nano.InternalNano;
import com.google.protobuf.nano.InvalidProtocolBufferNanoException;
import com.google.protobuf.nano.MessageNano;
import com.google.protobuf.nano.WireFormatNano;
import java.io.IOException;
import nano.BargainTicksRequest;

/* compiled from: TbsSdkJava */
public interface BargainTicksResponse {

    /* compiled from: TbsSdkJava */
    public static final class BargainTicks_Response extends MessageNano {

        private static volatile BargainTicks_Response[] _emptyArray;

        private int bitField0_;

        private int closePrice_;

        public BargainTicksRequest.BargainTicks_Request inputParams;

        private int lastDate_;

        private int openInterest_;

        public Bargain[] outputParams;

        /* compiled from: TbsSdkJava */
        public static final class Bargain extends MessageNano {

            private static volatile Bargain[] _emptyArray;

            private int bitField0_;

            private int direction_;

            private int index_;

            private int price_;

            private int time_;

            private long trade_;

            private long volume_;

            public Bargain() {
                clear();
            }

            public static Bargain[] emptyArray() {
                if (_emptyArray == null) {
                    synchronized (InternalNano.LAZY_INIT_LOCK) {
                        try {
                            if (_emptyArray == null) {
                                _emptyArray = new Bargain[0];
                            }
                        } catch (Throwable th) {
                            throw th;
                        }
                    }
                }
                return _emptyArray;
            }

            public static Bargain parseFrom(byte[] bArr) throws InvalidProtocolBufferNanoException {
                return (Bargain) MessageNano.mergeFrom(new Bargain(), bArr);
            }

            public Bargain clear() {
                this.bitField0_ = 0;
                this.time_ = 0;
                this.price_ = 0;
                this.volume_ = 0;
                this.trade_ = 0;
                this.direction_ = 0;
                this.index_ = 0;
                this.cachedSize = -1;
                return this;
            }

            public Bargain clearDirection() {
                this.direction_ = 0;
                this.bitField0_ &= -17;
                return this;
            }

            public Bargain clearIndex() {
                this.index_ = 0;
                this.bitField0_ &= -33;
                return this;
            }

            public Bargain clearPrice() {
                this.price_ = 0;
                this.bitField0_ &= -3;
                return this;
            }

            public Bargain clearTime() {
                this.time_ = 0;
                this.bitField0_ &= -2;
                return this;
            }

            public Bargain clearTrade() {
                this.trade_ = 0;
                this.bitField0_ &= -9;
                return this;
            }

            public Bargain clearVolume() {
                this.volume_ = 0;
                this.bitField0_ &= -5;
                return this;
            }

            /* access modifiers changed from: protected */
            public int computeSerializedSize() {
                int computeSerializedSize = super.computeSerializedSize();
                if ((this.bitField0_ & 1) != 0) {
                    computeSerializedSize += CodedOutputByteBufferNano.computeUInt32Size(1, this.time_);
                }
                if ((this.bitField0_ & 2) != 0) {
                    computeSerializedSize += CodedOutputByteBufferNano.computeUInt32Size(2, this.price_);
                }
                if ((this.bitField0_ & 4) != 0) {
                    computeSerializedSize += CodedOutputByteBufferNano.computeUInt64Size(3, this.volume_);
                }
                if ((this.bitField0_ & 8) != 0) {
                    computeSerializedSize += CodedOutputByteBufferNano.computeUInt64Size(4, this.trade_);
                }
                if ((this.bitField0_ & 16) != 0) {
                    computeSerializedSize += CodedOutputByteBufferNano.computeSInt32Size(5, this.direction_);
                }
                if ((this.bitField0_ & 32) != 0) {
                    return computeSerializedSize + CodedOutputByteBufferNano.computeUInt32Size(6, this.index_);
                }
                return computeSerializedSize;
            }

            public int getDirection() {
                return this.direction_;
            }

            public int getIndex() {
                return this.index_;
            }

            public int getPrice() {
                return this.price_;
            }

            public int getTime() {
                return this.time_;
            }

            public long getTrade() {
                return this.trade_;
            }

            public long getVolume() {
                return this.volume_;
            }

            public boolean hasDirection() {
                if ((this.bitField0_ & 16) != 0) {
                    return true;
                }
                return false;
            }

            public boolean hasIndex() {
                if ((this.bitField0_ & 32) != 0) {
                    return true;
                }
                return false;
            }

            public boolean hasPrice() {
                if ((this.bitField0_ & 2) != 0) {
                    return true;
                }
                return false;
            }

            public boolean hasTime() {
                if ((this.bitField0_ & 1) != 0) {
                    return true;
                }
                return false;
            }

            public boolean hasTrade() {
                if ((this.bitField0_ & 8) != 0) {
                    return true;
                }
                return false;
            }

            public boolean hasVolume() {
                if ((this.bitField0_ & 4) != 0) {
                    return true;
                }
                return false;
            }

            public Bargain setDirection(int i10) {
                this.direction_ = i10;
                this.bitField0_ |= 16;
                return this;
            }

            public Bargain setIndex(int i10) {
                this.index_ = i10;
                this.bitField0_ |= 32;
                return this;
            }

            public Bargain setPrice(int i10) {
                this.price_ = i10;
                this.bitField0_ |= 2;
                return this;
            }

            public Bargain setTime(int i10) {
                this.time_ = i10;
                this.bitField0_ |= 1;
                return this;
            }

            public Bargain setTrade(long j10) {
                this.trade_ = j10;
                this.bitField0_ |= 8;
                return this;
            }

            public Bargain setVolume(long j10) {
                this.volume_ = j10;
                this.bitField0_ |= 4;
                return this;
            }

            public void writeTo(CodedOutputByteBufferNano codedOutputByteBufferNano) throws IOException {
                if ((this.bitField0_ & 1) != 0) {
                    codedOutputByteBufferNano.writeUInt32(1, this.time_);
                }
                if ((this.bitField0_ & 2) != 0) {
                    codedOutputByteBufferNano.writeUInt32(2, this.price_);
                }
                if ((this.bitField0_ & 4) != 0) {
                    codedOutputByteBufferNano.writeUInt64(3, this.volume_);
                }
                if ((this.bitField0_ & 8) != 0) {
                    codedOutputByteBufferNano.writeUInt64(4, this.trade_);
                }
                if ((this.bitField0_ & 16) != 0) {
                    codedOutputByteBufferNano.writeSInt32(5, this.direction_);
                }
                if ((this.bitField0_ & 32) != 0) {
                    codedOutputByteBufferNano.writeUInt32(6, this.index_);
                }
                super.writeTo(codedOutputByteBufferNano);
            }

            public static Bargain parseFrom(CodedInputByteBufferNano codedInputByteBufferNano) throws IOException {
                return new Bargain().mergeFrom(codedInputByteBufferNano);
            }

            public Bargain mergeFrom(CodedInputByteBufferNano codedInputByteBufferNano) throws IOException {
                while (true) {
                    int readTag = codedInputByteBufferNano.readTag();
                    if (readTag == 0) {
                        return this;
                    }
                    if (readTag == 8) {
                        this.time_ = codedInputByteBufferNano.readUInt32();
                        this.bitField0_ |= 1;
                    } else if (readTag == 16) {
                        this.price_ = codedInputByteBufferNano.readUInt32();
                        this.bitField0_ |= 2;
                    } else if (readTag == 24) {
                        this.volume_ = codedInputByteBufferNano.readUInt64();
                        this.bitField0_ |= 4;
                    } else if (readTag == 32) {
                        this.trade_ = codedInputByteBufferNano.readUInt64();
                        this.bitField0_ |= 8;
                    } else if (readTag == 40) {
                        this.direction_ = codedInputByteBufferNano.readSInt32();
                        this.bitField0_ |= 16;
                    } else if (readTag == 48) {
                        this.index_ = codedInputByteBufferNano.readUInt32();
                        this.bitField0_ |= 32;
                    } else if (!WireFormatNano.parseUnknownField(codedInputByteBufferNano, readTag)) {
                        return this;
                    }
                }
            }
        }

        public BargainTicks_Response() {
            clear();
        }

        public static BargainTicks_Response[] emptyArray() {
            if (_emptyArray == null) {
                synchronized (InternalNano.LAZY_INIT_LOCK) {
                    try {
                        if (_emptyArray == null) {
                            _emptyArray = new BargainTicks_Response[0];
                        }
                    } catch (Throwable th) {
                        throw th;
                    }
                }
            }
            return _emptyArray;
        }

        public static BargainTicks_Response parseFrom(byte[] bArr) throws InvalidProtocolBufferNanoException {
            return (BargainTicks_Response) MessageNano.mergeFrom(new BargainTicks_Response(), bArr);
        }

        public BargainTicks_Response clear() {
            this.bitField0_ = 0;
            this.inputParams = null;
            this.outputParams = Bargain.emptyArray();
            this.lastDate_ = 0;
            this.closePrice_ = 0;
            this.openInterest_ = 0;
            this.cachedSize = -1;
            return this;
        }

        public BargainTicks_Response clearClosePrice() {
            this.closePrice_ = 0;
            this.bitField0_ &= -3;
            return this;
        }

        public BargainTicks_Response clearLastDate() {
            this.lastDate_ = 0;
            this.bitField0_ &= -2;
            return this;
        }

        public BargainTicks_Response clearOpenInterest() {
            this.openInterest_ = 0;
            this.bitField0_ &= -5;
            return this;
        }

        /* access modifiers changed from: protected */
        public int computeSerializedSize() {
            int computeSerializedSize = super.computeSerializedSize();
            BargainTicksRequest.BargainTicks_Request bargainTicks_Request = this.inputParams;
            if (bargainTicks_Request != null) {
                computeSerializedSize += CodedOutputByteBufferNano.computeMessageSize(1, bargainTicks_Request);
            }
            Bargain[] bargainArr = this.outputParams;
            if (bargainArr != null && bargainArr.length > 0) {
                int i10 = 0;
                while (true) {
                    Bargain[] bargainArr2 = this.outputParams;
                    if (i10 >= bargainArr2.length) {
                        break;
                    }
                    Bargain bargain = bargainArr2[i10];
                    if (bargain != null) {
                        computeSerializedSize += CodedOutputByteBufferNano.computeMessageSize(2, bargain);
                    }
                    i10++;
                }
            }
            if ((this.bitField0_ & 1) != 0) {
                computeSerializedSize += CodedOutputByteBufferNano.computeUInt32Size(3, this.lastDate_);
            }
            if ((this.bitField0_ & 2) != 0) {
                computeSerializedSize += CodedOutputByteBufferNano.computeUInt32Size(4, this.closePrice_);
            }
            if ((this.bitField0_ & 4) != 0) {
                return computeSerializedSize + CodedOutputByteBufferNano.computeUInt32Size(5, this.openInterest_);
            }
            return computeSerializedSize;
        }

        public int getClosePrice() {
            return this.closePrice_;
        }

        public int getLastDate() {
            return this.lastDate_;
        }

        public int getOpenInterest() {
            return this.openInterest_;
        }

        public boolean hasClosePrice() {
            if ((this.bitField0_ & 2) != 0) {
                return true;
            }
            return false;
        }

        public boolean hasLastDate() {
            if ((this.bitField0_ & 1) != 0) {
                return true;
            }
            return false;
        }

        public boolean hasOpenInterest() {
            if ((this.bitField0_ & 4) != 0) {
                return true;
            }
            return false;
        }

        public BargainTicks_Response setClosePrice(int i10) {
            this.closePrice_ = i10;
            this.bitField0_ |= 2;
            return this;
        }

        public BargainTicks_Response setLastDate(int i10) {
            this.lastDate_ = i10;
            this.bitField0_ |= 1;
            return this;
        }

        public BargainTicks_Response setOpenInterest(int i10) {
            this.openInterest_ = i10;
            this.bitField0_ |= 4;
            return this;
        }

        public void writeTo(CodedOutputByteBufferNano codedOutputByteBufferNano) throws IOException {
            BargainTicksRequest.BargainTicks_Request bargainTicks_Request = this.inputParams;
            if (bargainTicks_Request != null) {
                codedOutputByteBufferNano.writeMessage(1, bargainTicks_Request);
            }
            Bargain[] bargainArr = this.outputParams;
            if (bargainArr != null && bargainArr.length > 0) {
                int i10 = 0;
                while (true) {
                    Bargain[] bargainArr2 = this.outputParams;
                    if (i10 >= bargainArr2.length) {
                        break;
                    }
                    Bargain bargain = bargainArr2[i10];
                    if (bargain != null) {
                        codedOutputByteBufferNano.writeMessage(2, bargain);
                    }
                    i10++;
                }
            }
            if ((this.bitField0_ & 1) != 0) {
                codedOutputByteBufferNano.writeUInt32(3, this.lastDate_);
            }
            if ((this.bitField0_ & 2) != 0) {
                codedOutputByteBufferNano.writeUInt32(4, this.closePrice_);
            }
            if ((this.bitField0_ & 4) != 0) {
                codedOutputByteBufferNano.writeUInt32(5, this.openInterest_);
            }
            super.writeTo(codedOutputByteBufferNano);
        }

        public static BargainTicks_Response parseFrom(CodedInputByteBufferNano codedInputByteBufferNano) throws IOException {
            return new BargainTicks_Response().mergeFrom(codedInputByteBufferNano);
        }

        public BargainTicks_Response mergeFrom(CodedInputByteBufferNano codedInputByteBufferNano) throws IOException {
            while (true) {
                int readTag = codedInputByteBufferNano.readTag();
                if (readTag == 0) {
                    return this;
                }
                if (readTag == 10) {
                    if (this.inputParams == null) {
                        this.inputParams = new BargainTicksRequest.BargainTicks_Request();
                    }
                    codedInputByteBufferNano.readMessage(this.inputParams);
                } else if (readTag == 18) {
                    int repeatedFieldArrayLength = WireFormatNano.getRepeatedFieldArrayLength(codedInputByteBufferNano, 18);
                    Bargain[] bargainArr = this.outputParams;
                    int length = bargainArr == null ? 0 : bargainArr.length;
                    int i10 = repeatedFieldArrayLength + length;
                    Bargain[] bargainArr2 = new Bargain[i10];
                    if (length != 0) {
                        System.arraycopy(bargainArr, 0, bargainArr2, 0, length);
                    }
                    while (length < i10 - 1) {
                        Bargain bargain = new Bargain();
                        bargainArr2[length] = bargain;
                        codedInputByteBufferNano.readMessage(bargain);
                        codedInputByteBufferNano.readTag();
                        length++;
                    }
                    Bargain bargain2 = new Bargain();
                    bargainArr2[length] = bargain2;
                    codedInputByteBufferNano.readMessage(bargain2);
                    this.outputParams = bargainArr2;
                } else if (readTag == 24) {
                    this.lastDate_ = codedInputByteBufferNano.readUInt32();
                    this.bitField0_ |= 1;
                } else if (readTag == 32) {
                    this.closePrice_ = codedInputByteBufferNano.readUInt32();
                    this.bitField0_ |= 2;
                } else if (readTag == 40) {
                    this.openInterest_ = codedInputByteBufferNano.readUInt32();
                    this.bitField0_ |= 4;
                } else if (!WireFormatNano.parseUnknownField(codedInputByteBufferNano, readTag)) {
                    return this;
                }
            }
        }
    }
}
