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.MatrixDataRequest;

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

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

        private static volatile MatrixData_Response[] _emptyArray;

        private int bitField0_;

        private int closePrice_;

        public MatrixData[] goodsMatrix;

        private long goodsTime_;

        public MatrixDataRequest.MatrixData_Request requestParams;

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

            private static volatile MatrixData[] _emptyArray;

            private int bitField0_;

            private int price_;

            public int[] top50OrderVol;

            private long totalOrderNum_;

            private int tradeDirection_;

            private int tradeLevel_;

            private long volume_;

            public MatrixData() {
                clear();
            }

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

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

            public MatrixData clear() {
                this.bitField0_ = 0;
                this.tradeDirection_ = 0;
                this.tradeLevel_ = 0;
                this.price_ = 0;
                this.volume_ = 0;
                this.totalOrderNum_ = 0;
                this.top50OrderVol = WireFormatNano.EMPTY_INT_ARRAY;
                this.cachedSize = -1;
                return this;
            }

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

            public MatrixData clearTotalOrderNum() {
                this.totalOrderNum_ = 0;
                this.bitField0_ &= -17;
                return this;
            }

            public MatrixData clearTradeDirection() {
                this.tradeDirection_ = 0;
                this.bitField0_ &= -2;
                return this;
            }

            public MatrixData clearTradeLevel() {
                this.tradeLevel_ = 0;
                this.bitField0_ &= -3;
                return this;
            }

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

            /* access modifiers changed from: protected */
            public int computeSerializedSize() {
                int computeSerializedSize = super.computeSerializedSize();
                if ((this.bitField0_ & 1) != 0) {
                    computeSerializedSize += CodedOutputByteBufferNano.computeInt32Size(1, this.tradeDirection_);
                }
                if ((this.bitField0_ & 2) != 0) {
                    computeSerializedSize += CodedOutputByteBufferNano.computeUInt32Size(2, this.tradeLevel_);
                }
                if ((this.bitField0_ & 4) != 0) {
                    computeSerializedSize += CodedOutputByteBufferNano.computeUInt32Size(3, this.price_);
                }
                if ((this.bitField0_ & 8) != 0) {
                    computeSerializedSize += CodedOutputByteBufferNano.computeUInt64Size(4, this.volume_);
                }
                if ((this.bitField0_ & 16) != 0) {
                    computeSerializedSize += CodedOutputByteBufferNano.computeUInt64Size(5, this.totalOrderNum_);
                }
                int[] iArr = this.top50OrderVol;
                if (iArr == null || iArr.length <= 0) {
                    return computeSerializedSize;
                }
                int i10 = 0;
                int i11 = 0;
                while (true) {
                    int[] iArr2 = this.top50OrderVol;
                    if (i10 >= iArr2.length) {
                        return computeSerializedSize + i11 + iArr2.length;
                    }
                    i11 += CodedOutputByteBufferNano.computeUInt32SizeNoTag(iArr2[i10]);
                    i10++;
                }
            }

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

            public long getTotalOrderNum() {
                return this.totalOrderNum_;
            }

            public int getTradeDirection() {
                return this.tradeDirection_;
            }

            public int getTradeLevel() {
                return this.tradeLevel_;
            }

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

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

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

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

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

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

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

            public MatrixData setTotalOrderNum(long j10) {
                this.totalOrderNum_ = j10;
                this.bitField0_ |= 16;
                return this;
            }

            public MatrixData setTradeDirection(int i10) {
                this.tradeDirection_ = i10;
                this.bitField0_ |= 1;
                return this;
            }

            public MatrixData setTradeLevel(int i10) {
                this.tradeLevel_ = i10;
                this.bitField0_ |= 2;
                return this;
            }

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

            public void writeTo(CodedOutputByteBufferNano codedOutputByteBufferNano) throws IOException {
                if ((this.bitField0_ & 1) != 0) {
                    codedOutputByteBufferNano.writeInt32(1, this.tradeDirection_);
                }
                if ((this.bitField0_ & 2) != 0) {
                    codedOutputByteBufferNano.writeUInt32(2, this.tradeLevel_);
                }
                if ((this.bitField0_ & 4) != 0) {
                    codedOutputByteBufferNano.writeUInt32(3, this.price_);
                }
                if ((this.bitField0_ & 8) != 0) {
                    codedOutputByteBufferNano.writeUInt64(4, this.volume_);
                }
                if ((this.bitField0_ & 16) != 0) {
                    codedOutputByteBufferNano.writeUInt64(5, this.totalOrderNum_);
                }
                int[] iArr = this.top50OrderVol;
                if (iArr != null && iArr.length > 0) {
                    int i10 = 0;
                    while (true) {
                        int[] iArr2 = this.top50OrderVol;
                        if (i10 >= iArr2.length) {
                            break;
                        }
                        codedOutputByteBufferNano.writeUInt32(6, iArr2[i10]);
                        i10++;
                    }
                }
                super.writeTo(codedOutputByteBufferNano);
            }

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

            public MatrixData mergeFrom(CodedInputByteBufferNano codedInputByteBufferNano) throws IOException {
                while (true) {
                    int readTag = codedInputByteBufferNano.readTag();
                    if (readTag == 0) {
                        return this;
                    }
                    if (readTag == 8) {
                        this.tradeDirection_ = codedInputByteBufferNano.readInt32();
                        this.bitField0_ |= 1;
                    } else if (readTag == 16) {
                        this.tradeLevel_ = codedInputByteBufferNano.readUInt32();
                        this.bitField0_ |= 2;
                    } else if (readTag == 24) {
                        this.price_ = codedInputByteBufferNano.readUInt32();
                        this.bitField0_ |= 4;
                    } else if (readTag == 32) {
                        this.volume_ = codedInputByteBufferNano.readUInt64();
                        this.bitField0_ |= 8;
                    } else if (readTag == 40) {
                        this.totalOrderNum_ = codedInputByteBufferNano.readUInt64();
                        this.bitField0_ |= 16;
                    } else if (readTag == 48) {
                        int repeatedFieldArrayLength = WireFormatNano.getRepeatedFieldArrayLength(codedInputByteBufferNano, 48);
                        int[] iArr = this.top50OrderVol;
                        int length = iArr == null ? 0 : iArr.length;
                        int i10 = repeatedFieldArrayLength + length;
                        int[] iArr2 = new int[i10];
                        if (length != 0) {
                            System.arraycopy(iArr, 0, iArr2, 0, length);
                        }
                        while (length < i10 - 1) {
                            iArr2[length] = codedInputByteBufferNano.readUInt32();
                            codedInputByteBufferNano.readTag();
                            length++;
                        }
                        iArr2[length] = codedInputByteBufferNano.readUInt32();
                        this.top50OrderVol = iArr2;
                    } else if (readTag == 50) {
                        int pushLimit = codedInputByteBufferNano.pushLimit(codedInputByteBufferNano.readRawVarint32());
                        int position = codedInputByteBufferNano.getPosition();
                        int i11 = 0;
                        while (codedInputByteBufferNano.getBytesUntilLimit() > 0) {
                            codedInputByteBufferNano.readUInt32();
                            i11++;
                        }
                        codedInputByteBufferNano.rewindToPosition(position);
                        int[] iArr3 = this.top50OrderVol;
                        int length2 = iArr3 == null ? 0 : iArr3.length;
                        int i12 = i11 + length2;
                        int[] iArr4 = new int[i12];
                        if (length2 != 0) {
                            System.arraycopy(iArr3, 0, iArr4, 0, length2);
                        }
                        while (length2 < i12) {
                            iArr4[length2] = codedInputByteBufferNano.readUInt32();
                            length2++;
                        }
                        this.top50OrderVol = iArr4;
                        codedInputByteBufferNano.popLimit(pushLimit);
                    } else if (!WireFormatNano.parseUnknownField(codedInputByteBufferNano, readTag)) {
                        return this;
                    }
                }
            }
        }

        public MatrixData_Response() {
            clear();
        }

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

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

        public MatrixData_Response clear() {
            this.bitField0_ = 0;
            this.requestParams = null;
            this.goodsTime_ = 0;
            this.goodsMatrix = MatrixData.emptyArray();
            this.closePrice_ = 0;
            this.cachedSize = -1;
            return this;
        }

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

        public MatrixData_Response clearGoodsTime() {
            this.goodsTime_ = 0;
            this.bitField0_ &= -2;
            return this;
        }

        /* access modifiers changed from: protected */
        public int computeSerializedSize() {
            int computeSerializedSize = super.computeSerializedSize();
            MatrixDataRequest.MatrixData_Request matrixData_Request = this.requestParams;
            if (matrixData_Request != null) {
                computeSerializedSize += CodedOutputByteBufferNano.computeMessageSize(1, matrixData_Request);
            }
            if ((this.bitField0_ & 1) != 0) {
                computeSerializedSize += CodedOutputByteBufferNano.computeUInt64Size(2, this.goodsTime_);
            }
            MatrixData[] matrixDataArr = this.goodsMatrix;
            if (matrixDataArr != null && matrixDataArr.length > 0) {
                int i10 = 0;
                while (true) {
                    MatrixData[] matrixDataArr2 = this.goodsMatrix;
                    if (i10 >= matrixDataArr2.length) {
                        break;
                    }
                    MatrixData matrixData = matrixDataArr2[i10];
                    if (matrixData != null) {
                        computeSerializedSize += CodedOutputByteBufferNano.computeMessageSize(3, matrixData);
                    }
                    i10++;
                }
            }
            if ((this.bitField0_ & 2) != 0) {
                return computeSerializedSize + CodedOutputByteBufferNano.computeUInt32Size(4, this.closePrice_);
            }
            return computeSerializedSize;
        }

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

        public long getGoodsTime() {
            return this.goodsTime_;
        }

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

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

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

        public MatrixData_Response setGoodsTime(long j10) {
            this.goodsTime_ = j10;
            this.bitField0_ |= 1;
            return this;
        }

        public void writeTo(CodedOutputByteBufferNano codedOutputByteBufferNano) throws IOException {
            MatrixDataRequest.MatrixData_Request matrixData_Request = this.requestParams;
            if (matrixData_Request != null) {
                codedOutputByteBufferNano.writeMessage(1, matrixData_Request);
            }
            if ((this.bitField0_ & 1) != 0) {
                codedOutputByteBufferNano.writeUInt64(2, this.goodsTime_);
            }
            MatrixData[] matrixDataArr = this.goodsMatrix;
            if (matrixDataArr != null && matrixDataArr.length > 0) {
                int i10 = 0;
                while (true) {
                    MatrixData[] matrixDataArr2 = this.goodsMatrix;
                    if (i10 >= matrixDataArr2.length) {
                        break;
                    }
                    MatrixData matrixData = matrixDataArr2[i10];
                    if (matrixData != null) {
                        codedOutputByteBufferNano.writeMessage(3, matrixData);
                    }
                    i10++;
                }
            }
            if ((this.bitField0_ & 2) != 0) {
                codedOutputByteBufferNano.writeUInt32(4, this.closePrice_);
            }
            super.writeTo(codedOutputByteBufferNano);
        }

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

        public MatrixData_Response mergeFrom(CodedInputByteBufferNano codedInputByteBufferNano) throws IOException {
            while (true) {
                int readTag = codedInputByteBufferNano.readTag();
                if (readTag == 0) {
                    return this;
                }
                if (readTag == 10) {
                    if (this.requestParams == null) {
                        this.requestParams = new MatrixDataRequest.MatrixData_Request();
                    }
                    codedInputByteBufferNano.readMessage(this.requestParams);
                } else if (readTag == 16) {
                    this.goodsTime_ = codedInputByteBufferNano.readUInt64();
                    this.bitField0_ |= 1;
                } else if (readTag == 26) {
                    int repeatedFieldArrayLength = WireFormatNano.getRepeatedFieldArrayLength(codedInputByteBufferNano, 26);
                    MatrixData[] matrixDataArr = this.goodsMatrix;
                    int length = matrixDataArr == null ? 0 : matrixDataArr.length;
                    int i10 = repeatedFieldArrayLength + length;
                    MatrixData[] matrixDataArr2 = new MatrixData[i10];
                    if (length != 0) {
                        System.arraycopy(matrixDataArr, 0, matrixDataArr2, 0, length);
                    }
                    while (length < i10 - 1) {
                        MatrixData matrixData = new MatrixData();
                        matrixDataArr2[length] = matrixData;
                        codedInputByteBufferNano.readMessage(matrixData);
                        codedInputByteBufferNano.readTag();
                        length++;
                    }
                    MatrixData matrixData2 = new MatrixData();
                    matrixDataArr2[length] = matrixData2;
                    codedInputByteBufferNano.readMessage(matrixData2);
                    this.goodsMatrix = matrixDataArr2;
                } else if (readTag == 32) {
                    this.closePrice_ = codedInputByteBufferNano.readUInt32();
                    this.bitField0_ |= 2;
                } else if (!WireFormatNano.parseUnknownField(codedInputByteBufferNano, readTag)) {
                    return this;
                }
            }
        }
    }
}
