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.TrendBatchRequest;
import nano.TrendLineResponse;

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

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

        private static volatile TrendBatch_Response[] _emptyArray;

        public TrendBatchRequest.TrendBatch_Request requestParam;

        public TrendBatch[] trendmulti;

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

            private static volatile TrendBatch[] _emptyArray;

            private int bitField0_;

            private int goodsId_;

            public TrendLineResponse.TrendLine_Response.TrendLine[] trenddata;

            public TrendBatch() {
                clear();
            }

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

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

            public TrendBatch clear() {
                this.bitField0_ = 0;
                this.goodsId_ = 0;
                this.trenddata = TrendLineResponse.TrendLine_Response.TrendLine.emptyArray();
                this.cachedSize = -1;
                return this;
            }

            public TrendBatch 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_);
                }
                TrendLineResponse.TrendLine_Response.TrendLine[] trendLineArr = this.trenddata;
                if (trendLineArr != null && trendLineArr.length > 0) {
                    int i10 = 0;
                    while (true) {
                        TrendLineResponse.TrendLine_Response.TrendLine[] trendLineArr2 = this.trenddata;
                        if (i10 >= trendLineArr2.length) {
                            break;
                        }
                        TrendLineResponse.TrendLine_Response.TrendLine trendLine = trendLineArr2[i10];
                        if (trendLine != null) {
                            computeSerializedSize += CodedOutputByteBufferNano.computeMessageSize(2, trendLine);
                        }
                        i10++;
                    }
                }
                return computeSerializedSize;
            }

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

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

            public TrendBatch 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_);
                }
                TrendLineResponse.TrendLine_Response.TrendLine[] trendLineArr = this.trenddata;
                if (trendLineArr != null && trendLineArr.length > 0) {
                    int i10 = 0;
                    while (true) {
                        TrendLineResponse.TrendLine_Response.TrendLine[] trendLineArr2 = this.trenddata;
                        if (i10 >= trendLineArr2.length) {
                            break;
                        }
                        TrendLineResponse.TrendLine_Response.TrendLine trendLine = trendLineArr2[i10];
                        if (trendLine != null) {
                            codedOutputByteBufferNano.writeMessage(2, trendLine);
                        }
                        i10++;
                    }
                }
                super.writeTo(codedOutputByteBufferNano);
            }

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

            public TrendBatch 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);
                        TrendLineResponse.TrendLine_Response.TrendLine[] trendLineArr = this.trenddata;
                        int length = trendLineArr == null ? 0 : trendLineArr.length;
                        int i10 = repeatedFieldArrayLength + length;
                        TrendLineResponse.TrendLine_Response.TrendLine[] trendLineArr2 = new TrendLineResponse.TrendLine_Response.TrendLine[i10];
                        if (length != 0) {
                            System.arraycopy(trendLineArr, 0, trendLineArr2, 0, length);
                        }
                        while (length < i10 - 1) {
                            TrendLineResponse.TrendLine_Response.TrendLine trendLine = new TrendLineResponse.TrendLine_Response.TrendLine();
                            trendLineArr2[length] = trendLine;
                            codedInputByteBufferNano.readMessage(trendLine);
                            codedInputByteBufferNano.readTag();
                            length++;
                        }
                        TrendLineResponse.TrendLine_Response.TrendLine trendLine2 = new TrendLineResponse.TrendLine_Response.TrendLine();
                        trendLineArr2[length] = trendLine2;
                        codedInputByteBufferNano.readMessage(trendLine2);
                        this.trenddata = trendLineArr2;
                    } else if (!WireFormatNano.parseUnknownField(codedInputByteBufferNano, readTag)) {
                        return this;
                    }
                }
            }
        }

        public TrendBatch_Response() {
            clear();
        }

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

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

        public TrendBatch_Response clear() {
            this.requestParam = null;
            this.trendmulti = TrendBatch.emptyArray();
            this.cachedSize = -1;
            return this;
        }

        /* access modifiers changed from: protected */
        public int computeSerializedSize() {
            int computeSerializedSize = super.computeSerializedSize();
            TrendBatchRequest.TrendBatch_Request trendBatch_Request = this.requestParam;
            if (trendBatch_Request != null) {
                computeSerializedSize += CodedOutputByteBufferNano.computeMessageSize(1, trendBatch_Request);
            }
            TrendBatch[] trendBatchArr = this.trendmulti;
            if (trendBatchArr != null && trendBatchArr.length > 0) {
                int i10 = 0;
                while (true) {
                    TrendBatch[] trendBatchArr2 = this.trendmulti;
                    if (i10 >= trendBatchArr2.length) {
                        break;
                    }
                    TrendBatch trendBatch = trendBatchArr2[i10];
                    if (trendBatch != null) {
                        computeSerializedSize += CodedOutputByteBufferNano.computeMessageSize(2, trendBatch);
                    }
                    i10++;
                }
            }
            return computeSerializedSize;
        }

        public void writeTo(CodedOutputByteBufferNano codedOutputByteBufferNano) throws IOException {
            TrendBatchRequest.TrendBatch_Request trendBatch_Request = this.requestParam;
            if (trendBatch_Request != null) {
                codedOutputByteBufferNano.writeMessage(1, trendBatch_Request);
            }
            TrendBatch[] trendBatchArr = this.trendmulti;
            if (trendBatchArr != null && trendBatchArr.length > 0) {
                int i10 = 0;
                while (true) {
                    TrendBatch[] trendBatchArr2 = this.trendmulti;
                    if (i10 >= trendBatchArr2.length) {
                        break;
                    }
                    TrendBatch trendBatch = trendBatchArr2[i10];
                    if (trendBatch != null) {
                        codedOutputByteBufferNano.writeMessage(2, trendBatch);
                    }
                    i10++;
                }
            }
            super.writeTo(codedOutputByteBufferNano);
        }

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

        public TrendBatch_Response mergeFrom(CodedInputByteBufferNano codedInputByteBufferNano) throws IOException {
            while (true) {
                int readTag = codedInputByteBufferNano.readTag();
                if (readTag == 0) {
                    return this;
                }
                if (readTag == 10) {
                    if (this.requestParam == null) {
                        this.requestParam = new TrendBatchRequest.TrendBatch_Request();
                    }
                    codedInputByteBufferNano.readMessage(this.requestParam);
                } else if (readTag == 18) {
                    int repeatedFieldArrayLength = WireFormatNano.getRepeatedFieldArrayLength(codedInputByteBufferNano, 18);
                    TrendBatch[] trendBatchArr = this.trendmulti;
                    int length = trendBatchArr == null ? 0 : trendBatchArr.length;
                    int i10 = repeatedFieldArrayLength + length;
                    TrendBatch[] trendBatchArr2 = new TrendBatch[i10];
                    if (length != 0) {
                        System.arraycopy(trendBatchArr, 0, trendBatchArr2, 0, length);
                    }
                    while (length < i10 - 1) {
                        TrendBatch trendBatch = new TrendBatch();
                        trendBatchArr2[length] = trendBatch;
                        codedInputByteBufferNano.readMessage(trendBatch);
                        codedInputByteBufferNano.readTag();
                        length++;
                    }
                    TrendBatch trendBatch2 = new TrendBatch();
                    trendBatchArr2[length] = trendBatch2;
                    codedInputByteBufferNano.readMessage(trendBatch2);
                    this.trendmulti = trendBatchArr2;
                } else if (!WireFormatNano.parseUnknownField(codedInputByteBufferNano, readTag)) {
                    return this;
                }
            }
        }
    }
}
