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.MapFactories;
import com.google.protobuf.nano.MessageNano;
import com.google.protobuf.nano.WireFormatNano;
import java.io.IOException;
import java.util.Map;
import nano.CandleStickNewResponse;
import nano.CandleStickWithIndexRequest;
import nano.IndexCalcNewExResponse;

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

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

        private static volatile CandleStickNewWithIndexEx_Response[] _emptyArray;

        public CandleStickNewResponse.CandleStickNew_Response.FHSP[] fhsp;

        public CandleStickNewResponse.CandleStickNew_Response.HisShares[] hisshares;

        public Map<String, IndLine> indexDatas;

        public CandleStickNewResponse.CandleStickNew_Response.CandleStick[] kLines;

        public CandleStickWithIndexRequest.CandleStickWithIndex_Request requestParams;

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

            private static volatile IndLine[] _emptyArray;

            private int bitField0_;

            public IndexCalcNewExResponse.IndexCalcNewEx_Response.color_ex[] lineColor;

            public IndexCalcNewExResponse.IndexCalcNewEx_Response.outputline[] lineValue;

            private boolean masterOverlay_;

            public IndLine() {
                clear();
            }

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

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

            public IndLine clear() {
                this.bitField0_ = 0;
                this.lineValue = IndexCalcNewExResponse.IndexCalcNewEx_Response.outputline.emptyArray();
                this.masterOverlay_ = false;
                this.lineColor = IndexCalcNewExResponse.IndexCalcNewEx_Response.color_ex.emptyArray();
                this.cachedSize = -1;
                return this;
            }

            public IndLine clearMasterOverlay() {
                this.masterOverlay_ = false;
                this.bitField0_ &= -2;
                return this;
            }

            /* access modifiers changed from: protected */
            public int computeSerializedSize() {
                int computeSerializedSize = super.computeSerializedSize();
                IndexCalcNewExResponse.IndexCalcNewEx_Response.outputline[] outputlineArr = this.lineValue;
                int i10 = 0;
                if (outputlineArr != null && outputlineArr.length > 0) {
                    int i11 = 0;
                    while (true) {
                        IndexCalcNewExResponse.IndexCalcNewEx_Response.outputline[] outputlineArr2 = this.lineValue;
                        if (i11 >= outputlineArr2.length) {
                            break;
                        }
                        IndexCalcNewExResponse.IndexCalcNewEx_Response.outputline outputline = outputlineArr2[i11];
                        if (outputline != null) {
                            computeSerializedSize += CodedOutputByteBufferNano.computeMessageSize(1, outputline);
                        }
                        i11++;
                    }
                }
                if ((this.bitField0_ & 1) != 0) {
                    computeSerializedSize += CodedOutputByteBufferNano.computeBoolSize(2, this.masterOverlay_);
                }
                IndexCalcNewExResponse.IndexCalcNewEx_Response.color_ex[] color_exArr = this.lineColor;
                if (color_exArr != null && color_exArr.length > 0) {
                    while (true) {
                        IndexCalcNewExResponse.IndexCalcNewEx_Response.color_ex[] color_exArr2 = this.lineColor;
                        if (i10 >= color_exArr2.length) {
                            break;
                        }
                        IndexCalcNewExResponse.IndexCalcNewEx_Response.color_ex color_ex = color_exArr2[i10];
                        if (color_ex != null) {
                            computeSerializedSize += CodedOutputByteBufferNano.computeMessageSize(3, color_ex);
                        }
                        i10++;
                    }
                }
                return computeSerializedSize;
            }

            public boolean getMasterOverlay() {
                return this.masterOverlay_;
            }

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

            public IndLine setMasterOverlay(boolean z9) {
                this.masterOverlay_ = z9;
                this.bitField0_ |= 1;
                return this;
            }

            public void writeTo(CodedOutputByteBufferNano codedOutputByteBufferNano) throws IOException {
                IndexCalcNewExResponse.IndexCalcNewEx_Response.outputline[] outputlineArr = this.lineValue;
                int i10 = 0;
                if (outputlineArr != null && outputlineArr.length > 0) {
                    int i11 = 0;
                    while (true) {
                        IndexCalcNewExResponse.IndexCalcNewEx_Response.outputline[] outputlineArr2 = this.lineValue;
                        if (i11 >= outputlineArr2.length) {
                            break;
                        }
                        IndexCalcNewExResponse.IndexCalcNewEx_Response.outputline outputline = outputlineArr2[i11];
                        if (outputline != null) {
                            codedOutputByteBufferNano.writeMessage(1, outputline);
                        }
                        i11++;
                    }
                }
                if ((this.bitField0_ & 1) != 0) {
                    codedOutputByteBufferNano.writeBool(2, this.masterOverlay_);
                }
                IndexCalcNewExResponse.IndexCalcNewEx_Response.color_ex[] color_exArr = this.lineColor;
                if (color_exArr != null && color_exArr.length > 0) {
                    while (true) {
                        IndexCalcNewExResponse.IndexCalcNewEx_Response.color_ex[] color_exArr2 = this.lineColor;
                        if (i10 >= color_exArr2.length) {
                            break;
                        }
                        IndexCalcNewExResponse.IndexCalcNewEx_Response.color_ex color_ex = color_exArr2[i10];
                        if (color_ex != null) {
                            codedOutputByteBufferNano.writeMessage(3, color_ex);
                        }
                        i10++;
                    }
                }
                super.writeTo(codedOutputByteBufferNano);
            }

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

            public IndLine mergeFrom(CodedInputByteBufferNano codedInputByteBufferNano) throws IOException {
                while (true) {
                    int readTag = codedInputByteBufferNano.readTag();
                    if (readTag == 0) {
                        return this;
                    }
                    if (readTag == 10) {
                        int repeatedFieldArrayLength = WireFormatNano.getRepeatedFieldArrayLength(codedInputByteBufferNano, 10);
                        IndexCalcNewExResponse.IndexCalcNewEx_Response.outputline[] outputlineArr = this.lineValue;
                        int length = outputlineArr == null ? 0 : outputlineArr.length;
                        int i10 = repeatedFieldArrayLength + length;
                        IndexCalcNewExResponse.IndexCalcNewEx_Response.outputline[] outputlineArr2 = new IndexCalcNewExResponse.IndexCalcNewEx_Response.outputline[i10];
                        if (length != 0) {
                            System.arraycopy(outputlineArr, 0, outputlineArr2, 0, length);
                        }
                        while (length < i10 - 1) {
                            IndexCalcNewExResponse.IndexCalcNewEx_Response.outputline outputline = new IndexCalcNewExResponse.IndexCalcNewEx_Response.outputline();
                            outputlineArr2[length] = outputline;
                            codedInputByteBufferNano.readMessage(outputline);
                            codedInputByteBufferNano.readTag();
                            length++;
                        }
                        IndexCalcNewExResponse.IndexCalcNewEx_Response.outputline outputline2 = new IndexCalcNewExResponse.IndexCalcNewEx_Response.outputline();
                        outputlineArr2[length] = outputline2;
                        codedInputByteBufferNano.readMessage(outputline2);
                        this.lineValue = outputlineArr2;
                    } else if (readTag == 16) {
                        this.masterOverlay_ = codedInputByteBufferNano.readBool();
                        this.bitField0_ |= 1;
                    } else if (readTag == 26) {
                        int repeatedFieldArrayLength2 = WireFormatNano.getRepeatedFieldArrayLength(codedInputByteBufferNano, 26);
                        IndexCalcNewExResponse.IndexCalcNewEx_Response.color_ex[] color_exArr = this.lineColor;
                        int length2 = color_exArr == null ? 0 : color_exArr.length;
                        int i11 = repeatedFieldArrayLength2 + length2;
                        IndexCalcNewExResponse.IndexCalcNewEx_Response.color_ex[] color_exArr2 = new IndexCalcNewExResponse.IndexCalcNewEx_Response.color_ex[i11];
                        if (length2 != 0) {
                            System.arraycopy(color_exArr, 0, color_exArr2, 0, length2);
                        }
                        while (length2 < i11 - 1) {
                            IndexCalcNewExResponse.IndexCalcNewEx_Response.color_ex color_ex = new IndexCalcNewExResponse.IndexCalcNewEx_Response.color_ex();
                            color_exArr2[length2] = color_ex;
                            codedInputByteBufferNano.readMessage(color_ex);
                            codedInputByteBufferNano.readTag();
                            length2++;
                        }
                        IndexCalcNewExResponse.IndexCalcNewEx_Response.color_ex color_ex2 = new IndexCalcNewExResponse.IndexCalcNewEx_Response.color_ex();
                        color_exArr2[length2] = color_ex2;
                        codedInputByteBufferNano.readMessage(color_ex2);
                        this.lineColor = color_exArr2;
                    } else if (!WireFormatNano.parseUnknownField(codedInputByteBufferNano, readTag)) {
                        return this;
                    }
                }
            }
        }

        public CandleStickNewWithIndexEx_Response() {
            clear();
        }

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

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

        public CandleStickNewWithIndexEx_Response clear() {
            this.requestParams = null;
            this.kLines = CandleStickNewResponse.CandleStickNew_Response.CandleStick.emptyArray();
            this.indexDatas = null;
            this.hisshares = CandleStickNewResponse.CandleStickNew_Response.HisShares.emptyArray();
            this.fhsp = CandleStickNewResponse.CandleStickNew_Response.FHSP.emptyArray();
            this.cachedSize = -1;
            return this;
        }

        /* access modifiers changed from: protected */
        public int computeSerializedSize() {
            int computeSerializedSize = super.computeSerializedSize();
            CandleStickWithIndexRequest.CandleStickWithIndex_Request candleStickWithIndex_Request = this.requestParams;
            if (candleStickWithIndex_Request != null) {
                computeSerializedSize += CodedOutputByteBufferNano.computeMessageSize(1, candleStickWithIndex_Request);
            }
            CandleStickNewResponse.CandleStickNew_Response.CandleStick[] candleStickArr = this.kLines;
            int i10 = 0;
            if (candleStickArr != null && candleStickArr.length > 0) {
                int i11 = 0;
                while (true) {
                    CandleStickNewResponse.CandleStickNew_Response.CandleStick[] candleStickArr2 = this.kLines;
                    if (i11 >= candleStickArr2.length) {
                        break;
                    }
                    CandleStickNewResponse.CandleStickNew_Response.CandleStick candleStick = candleStickArr2[i11];
                    if (candleStick != null) {
                        computeSerializedSize += CodedOutputByteBufferNano.computeMessageSize(2, candleStick);
                    }
                    i11++;
                }
            }
            Map<String, IndLine> map = this.indexDatas;
            if (map != null) {
                computeSerializedSize += InternalNano.computeMapFieldSize(map, 3, 9, 11);
            }
            CandleStickNewResponse.CandleStickNew_Response.HisShares[] hisSharesArr = this.hisshares;
            if (hisSharesArr != null && hisSharesArr.length > 0) {
                int i12 = 0;
                while (true) {
                    CandleStickNewResponse.CandleStickNew_Response.HisShares[] hisSharesArr2 = this.hisshares;
                    if (i12 >= hisSharesArr2.length) {
                        break;
                    }
                    CandleStickNewResponse.CandleStickNew_Response.HisShares hisShares = hisSharesArr2[i12];
                    if (hisShares != null) {
                        computeSerializedSize += CodedOutputByteBufferNano.computeMessageSize(4, hisShares);
                    }
                    i12++;
                }
            }
            CandleStickNewResponse.CandleStickNew_Response.FHSP[] fhspArr = this.fhsp;
            if (fhspArr != null && fhspArr.length > 0) {
                while (true) {
                    CandleStickNewResponse.CandleStickNew_Response.FHSP[] fhspArr2 = this.fhsp;
                    if (i10 >= fhspArr2.length) {
                        break;
                    }
                    CandleStickNewResponse.CandleStickNew_Response.FHSP fhsp2 = fhspArr2[i10];
                    if (fhsp2 != null) {
                        computeSerializedSize += CodedOutputByteBufferNano.computeMessageSize(5, fhsp2);
                    }
                    i10++;
                }
            }
            return computeSerializedSize;
        }

        public void writeTo(CodedOutputByteBufferNano codedOutputByteBufferNano) throws IOException {
            CandleStickWithIndexRequest.CandleStickWithIndex_Request candleStickWithIndex_Request = this.requestParams;
            if (candleStickWithIndex_Request != null) {
                codedOutputByteBufferNano.writeMessage(1, candleStickWithIndex_Request);
            }
            CandleStickNewResponse.CandleStickNew_Response.CandleStick[] candleStickArr = this.kLines;
            int i10 = 0;
            if (candleStickArr != null && candleStickArr.length > 0) {
                int i11 = 0;
                while (true) {
                    CandleStickNewResponse.CandleStickNew_Response.CandleStick[] candleStickArr2 = this.kLines;
                    if (i11 >= candleStickArr2.length) {
                        break;
                    }
                    CandleStickNewResponse.CandleStickNew_Response.CandleStick candleStick = candleStickArr2[i11];
                    if (candleStick != null) {
                        codedOutputByteBufferNano.writeMessage(2, candleStick);
                    }
                    i11++;
                }
            }
            Map<String, IndLine> map = this.indexDatas;
            if (map != null) {
                InternalNano.serializeMapField(codedOutputByteBufferNano, map, 3, 9, 11);
            }
            CandleStickNewResponse.CandleStickNew_Response.HisShares[] hisSharesArr = this.hisshares;
            if (hisSharesArr != null && hisSharesArr.length > 0) {
                int i12 = 0;
                while (true) {
                    CandleStickNewResponse.CandleStickNew_Response.HisShares[] hisSharesArr2 = this.hisshares;
                    if (i12 >= hisSharesArr2.length) {
                        break;
                    }
                    CandleStickNewResponse.CandleStickNew_Response.HisShares hisShares = hisSharesArr2[i12];
                    if (hisShares != null) {
                        codedOutputByteBufferNano.writeMessage(4, hisShares);
                    }
                    i12++;
                }
            }
            CandleStickNewResponse.CandleStickNew_Response.FHSP[] fhspArr = this.fhsp;
            if (fhspArr != null && fhspArr.length > 0) {
                while (true) {
                    CandleStickNewResponse.CandleStickNew_Response.FHSP[] fhspArr2 = this.fhsp;
                    if (i10 >= fhspArr2.length) {
                        break;
                    }
                    CandleStickNewResponse.CandleStickNew_Response.FHSP fhsp2 = fhspArr2[i10];
                    if (fhsp2 != null) {
                        codedOutputByteBufferNano.writeMessage(5, fhsp2);
                    }
                    i10++;
                }
            }
            super.writeTo(codedOutputByteBufferNano);
        }

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

        public CandleStickNewWithIndexEx_Response mergeFrom(CodedInputByteBufferNano codedInputByteBufferNano) throws IOException {
            MapFactories.MapFactory mapFactory = MapFactories.getMapFactory();
            while (true) {
                int readTag = codedInputByteBufferNano.readTag();
                if (readTag == 0) {
                    return this;
                }
                if (readTag == 10) {
                    if (this.requestParams == null) {
                        this.requestParams = new CandleStickWithIndexRequest.CandleStickWithIndex_Request();
                    }
                    codedInputByteBufferNano.readMessage(this.requestParams);
                } 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 (readTag == 26) {
                    this.indexDatas = InternalNano.mergeMapEntry(codedInputByteBufferNano, this.indexDatas, mapFactory, 9, 11, new IndLine(), 10, 18);
                } else if (readTag == 34) {
                    int repeatedFieldArrayLength2 = WireFormatNano.getRepeatedFieldArrayLength(codedInputByteBufferNano, 34);
                    CandleStickNewResponse.CandleStickNew_Response.HisShares[] hisSharesArr = this.hisshares;
                    int length2 = hisSharesArr == null ? 0 : hisSharesArr.length;
                    int i11 = repeatedFieldArrayLength2 + length2;
                    CandleStickNewResponse.CandleStickNew_Response.HisShares[] hisSharesArr2 = new CandleStickNewResponse.CandleStickNew_Response.HisShares[i11];
                    if (length2 != 0) {
                        System.arraycopy(hisSharesArr, 0, hisSharesArr2, 0, length2);
                    }
                    while (length2 < i11 - 1) {
                        CandleStickNewResponse.CandleStickNew_Response.HisShares hisShares = new CandleStickNewResponse.CandleStickNew_Response.HisShares();
                        hisSharesArr2[length2] = hisShares;
                        codedInputByteBufferNano.readMessage(hisShares);
                        codedInputByteBufferNano.readTag();
                        length2++;
                    }
                    CandleStickNewResponse.CandleStickNew_Response.HisShares hisShares2 = new CandleStickNewResponse.CandleStickNew_Response.HisShares();
                    hisSharesArr2[length2] = hisShares2;
                    codedInputByteBufferNano.readMessage(hisShares2);
                    this.hisshares = hisSharesArr2;
                } else if (readTag == 42) {
                    int repeatedFieldArrayLength3 = WireFormatNano.getRepeatedFieldArrayLength(codedInputByteBufferNano, 42);
                    CandleStickNewResponse.CandleStickNew_Response.FHSP[] fhspArr = this.fhsp;
                    int length3 = fhspArr == null ? 0 : fhspArr.length;
                    int i12 = repeatedFieldArrayLength3 + length3;
                    CandleStickNewResponse.CandleStickNew_Response.FHSP[] fhspArr2 = new CandleStickNewResponse.CandleStickNew_Response.FHSP[i12];
                    if (length3 != 0) {
                        System.arraycopy(fhspArr, 0, fhspArr2, 0, length3);
                    }
                    while (length3 < i12 - 1) {
                        CandleStickNewResponse.CandleStickNew_Response.FHSP fhsp2 = new CandleStickNewResponse.CandleStickNew_Response.FHSP();
                        fhspArr2[length3] = fhsp2;
                        codedInputByteBufferNano.readMessage(fhsp2);
                        codedInputByteBufferNano.readTag();
                        length3++;
                    }
                    CandleStickNewResponse.CandleStickNew_Response.FHSP fhsp3 = new CandleStickNewResponse.CandleStickNew_Response.FHSP();
                    fhspArr2[length3] = fhsp3;
                    codedInputByteBufferNano.readMessage(fhsp3);
                    this.fhsp = fhspArr2;
                } else if (!WireFormatNano.parseUnknownField(codedInputByteBufferNano, readTag)) {
                    return this;
                }
            }
        }
    }
}
