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.CandleBatchRequest;
import nano.CandleStickNewResponse;

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

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

        private static volatile CandleBatch_Response[] _emptyArray;

        public CandleBatch[] kmulti;

        public CandleBatchRequest.CandleBatch_Request requestParams;

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

            private static volatile CandleBatch[] _emptyArray;

            private int bitField0_;

            private int goodsId_;

            public CandleStickNewResponse.CandleStickNew_Response.CandleStick[] kLines;

            public CandleBatch() {
                clear();
            }

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

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

            public CandleBatch clear() {
                this.bitField0_ = 0;
                this.goodsId_ = 0;
                this.kLines = CandleStickNewResponse.CandleStickNew_Response.CandleStick.emptyArray();
                this.cachedSize = -1;
                return this;
            }

            public CandleBatch clearGoodsId() {
                this.goodsId_ = 0;
                this.bitField0_ &= -2;
                return this;
            }

            /* access modifiers changed from: protected */
            public int computeSerializedSize() {
                int computeSerializedSize = super.computeSerializedSize();
                if ((this.bitField0_ & 1) != 0) {
                    computeSerializedSize += CodedOutputByteBufferNano.computeUInt32Size(1, this.goodsId_);
                }
                CandleStickNewResponse.CandleStickNew_Response.CandleStick[] candleStickArr = this.kLines;
                if (candleStickArr != null && candleStickArr.length > 0) {
                    int i10 = 0;
                    while (true) {
                        CandleStickNewResponse.CandleStickNew_Response.CandleStick[] candleStickArr2 = this.kLines;
                        if (i10 >= candleStickArr2.length) {
                            break;
                        }
                        CandleStickNewResponse.CandleStickNew_Response.CandleStick candleStick = candleStickArr2[i10];
                        if (candleStick != null) {
                            computeSerializedSize += CodedOutputByteBufferNano.computeMessageSize(2, candleStick);
                        }
                        i10++;
                    }
                }
                return computeSerializedSize;
            }

            public int getGoodsId() {
                return this.goodsId_;
            }

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

            public CandleBatch setGoodsId(int i10) {
                this.goodsId_ = i10;
                this.bitField0_ |= 1;
                return this;
            }

            public void writeTo(CodedOutputByteBufferNano codedOutputByteBufferNano) throws IOException {
                if ((this.bitField0_ & 1) != 0) {
                    codedOutputByteBufferNano.writeUInt32(1, this.goodsId_);
                }
                CandleStickNewResponse.CandleStickNew_Response.CandleStick[] candleStickArr = this.kLines;
                if (candleStickArr != null && candleStickArr.length > 0) {
                    int i10 = 0;
                    while (true) {
                        CandleStickNewResponse.CandleStickNew_Response.CandleStick[] candleStickArr2 = this.kLines;
                        if (i10 >= candleStickArr2.length) {
                            break;
                        }
                        CandleStickNewResponse.CandleStickNew_Response.CandleStick candleStick = candleStickArr2[i10];
                        if (candleStick != null) {
                            codedOutputByteBufferNano.writeMessage(2, candleStick);
                        }
                        i10++;
                    }
                }
                super.writeTo(codedOutputByteBufferNano);
            }

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

            public CandleBatch mergeFrom(CodedInputByteBufferNano codedInputByteBufferNano) throws IOException {
                while (true) {
                    int readTag = codedInputByteBufferNano.readTag();
                    if (readTag == 0) {
                        return this;
                    }
                    if (readTag == 8) {
                        this.goodsId_ = codedInputByteBufferNano.readUInt32();
                        this.bitField0_ |= 1;
                    } else if (readTag == 18) {
                        int repeatedFieldArrayLength = WireFormatNano.getRepeatedFieldArrayLength(codedInputByteBufferNano, 18);
                        CandleStickNewResponse.CandleStickNew_Response.CandleStick[] candleStickArr = this.kLines;
                        int length = candleStickArr == null ? 0 : candleStickArr.length;
                        int i10 = repeatedFieldArrayLength + length;
                        CandleStickNewResponse.CandleStickNew_Response.CandleStick[] candleStickArr2 = new CandleStickNewResponse.CandleStickNew_Response.CandleStick[i10];
                        if (length != 0) {
                            System.arraycopy(candleStickArr, 0, candleStickArr2, 0, length);
                        }
                        while (length < i10 - 1) {
                            CandleStickNewResponse.CandleStickNew_Response.CandleStick candleStick = new CandleStickNewResponse.CandleStickNew_Response.CandleStick();
                            candleStickArr2[length] = candleStick;
                            codedInputByteBufferNano.readMessage(candleStick);
                            codedInputByteBufferNano.readTag();
                            length++;
                        }
                        CandleStickNewResponse.CandleStickNew_Response.CandleStick candleStick2 = new CandleStickNewResponse.CandleStickNew_Response.CandleStick();
                        candleStickArr2[length] = candleStick2;
                        codedInputByteBufferNano.readMessage(candleStick2);
                        this.kLines = candleStickArr2;
                    } else if (!WireFormatNano.parseUnknownField(codedInputByteBufferNano, readTag)) {
                        return this;
                    }
                }
            }
        }

        public CandleBatch_Response() {
            clear();
        }

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

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

        public CandleBatch_Response clear() {
            this.requestParams = null;
            this.kmulti = CandleBatch.emptyArray();
            this.cachedSize = -1;
            return this;
        }

        /* access modifiers changed from: protected */
        public int computeSerializedSize() {
            int computeSerializedSize = super.computeSerializedSize();
            CandleBatchRequest.CandleBatch_Request candleBatch_Request = this.requestParams;
            if (candleBatch_Request != null) {
                computeSerializedSize += CodedOutputByteBufferNano.computeMessageSize(1, candleBatch_Request);
            }
            CandleBatch[] candleBatchArr = this.kmulti;
            if (candleBatchArr != null && candleBatchArr.length > 0) {
                int i10 = 0;
                while (true) {
                    CandleBatch[] candleBatchArr2 = this.kmulti;
                    if (i10 >= candleBatchArr2.length) {
                        break;
                    }
                    CandleBatch candleBatch = candleBatchArr2[i10];
                    if (candleBatch != null) {
                        computeSerializedSize += CodedOutputByteBufferNano.computeMessageSize(2, candleBatch);
                    }
                    i10++;
                }
            }
            return computeSerializedSize;
        }

        public void writeTo(CodedOutputByteBufferNano codedOutputByteBufferNano) throws IOException {
            CandleBatchRequest.CandleBatch_Request candleBatch_Request = this.requestParams;
            if (candleBatch_Request != null) {
                codedOutputByteBufferNano.writeMessage(1, candleBatch_Request);
            }
            CandleBatch[] candleBatchArr = this.kmulti;
            if (candleBatchArr != null && candleBatchArr.length > 0) {
                int i10 = 0;
                while (true) {
                    CandleBatch[] candleBatchArr2 = this.kmulti;
                    if (i10 >= candleBatchArr2.length) {
                        break;
                    }
                    CandleBatch candleBatch = candleBatchArr2[i10];
                    if (candleBatch != null) {
                        codedOutputByteBufferNano.writeMessage(2, candleBatch);
                    }
                    i10++;
                }
            }
            super.writeTo(codedOutputByteBufferNano);
        }

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

        public CandleBatch_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 CandleBatchRequest.CandleBatch_Request();
                    }
                    codedInputByteBufferNano.readMessage(this.requestParams);
                } else if (readTag == 18) {
                    int repeatedFieldArrayLength = WireFormatNano.getRepeatedFieldArrayLength(codedInputByteBufferNano, 18);
                    CandleBatch[] candleBatchArr = this.kmulti;
                    int length = candleBatchArr == null ? 0 : candleBatchArr.length;
                    int i10 = repeatedFieldArrayLength + length;
                    CandleBatch[] candleBatchArr2 = new CandleBatch[i10];
                    if (length != 0) {
                        System.arraycopy(candleBatchArr, 0, candleBatchArr2, 0, length);
                    }
                    while (length < i10 - 1) {
                        CandleBatch candleBatch = new CandleBatch();
                        candleBatchArr2[length] = candleBatch;
                        codedInputByteBufferNano.readMessage(candleBatch);
                        codedInputByteBufferNano.readTag();
                        length++;
                    }
                    CandleBatch candleBatch2 = new CandleBatch();
                    candleBatchArr2[length] = candleBatch2;
                    codedInputByteBufferNano.readMessage(candleBatch2);
                    this.kmulti = candleBatchArr2;
                } else if (!WireFormatNano.parseUnknownField(codedInputByteBufferNano, readTag)) {
                    return this;
                }
            }
        }
    }
}
