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

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

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

        private static volatile SortedList_Response[] _emptyArray;

        private int bitField0_;

        public SortedListRequest.SortedList_Request requestParams;

        private int totalSize_;

        public ValueData[] valueList;

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

            private static volatile ValueData[] _emptyArray;

            private int bitField0_;

            private long category_;

            private int exchange_;

            public String[] fieldValue;

            private int goodsId_;

            private int tradeSession_;

            public ValueData() {
                clear();
            }

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

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

            public ValueData clear() {
                this.bitField0_ = 0;
                this.goodsId_ = 0;
                this.fieldValue = WireFormatNano.EMPTY_STRING_ARRAY;
                this.exchange_ = 0;
                this.category_ = 0;
                this.tradeSession_ = 0;
                this.cachedSize = -1;
                return this;
            }

            public ValueData clearCategory() {
                this.category_ = 0;
                this.bitField0_ &= -5;
                return this;
            }

            public ValueData clearExchange() {
                this.exchange_ = 0;
                this.bitField0_ &= -3;
                return this;
            }

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

            public ValueData clearTradeSession() {
                this.tradeSession_ = 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.computeUInt32Size(1, this.goodsId_);
                }
                String[] strArr = this.fieldValue;
                if (strArr != null && strArr.length > 0) {
                    int i10 = 0;
                    int i11 = 0;
                    int i12 = 0;
                    while (true) {
                        String[] strArr2 = this.fieldValue;
                        if (i10 >= strArr2.length) {
                            break;
                        }
                        String str = strArr2[i10];
                        if (str != null) {
                            i12++;
                            i11 += CodedOutputByteBufferNano.computeStringSizeNoTag(str);
                        }
                        i10++;
                    }
                    computeSerializedSize = computeSerializedSize + i11 + i12;
                }
                if ((this.bitField0_ & 2) != 0) {
                    computeSerializedSize += CodedOutputByteBufferNano.computeUInt32Size(3, this.exchange_);
                }
                if ((this.bitField0_ & 4) != 0) {
                    computeSerializedSize += CodedOutputByteBufferNano.computeUInt64Size(4, this.category_);
                }
                if ((this.bitField0_ & 8) != 0) {
                    return computeSerializedSize + CodedOutputByteBufferNano.computeUInt32Size(5, this.tradeSession_);
                }
                return computeSerializedSize;
            }

            public long getCategory() {
                return this.category_;
            }

            public int getExchange() {
                return this.exchange_;
            }

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

            public int getTradeSession() {
                return this.tradeSession_;
            }

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

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

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

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

            public ValueData setCategory(long j10) {
                this.category_ = j10;
                this.bitField0_ |= 4;
                return this;
            }

            public ValueData setExchange(int i10) {
                this.exchange_ = i10;
                this.bitField0_ |= 2;
                return this;
            }

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

            public ValueData setTradeSession(int i10) {
                this.tradeSession_ = i10;
                this.bitField0_ |= 8;
                return this;
            }

            public void writeTo(CodedOutputByteBufferNano codedOutputByteBufferNano) throws IOException {
                if ((this.bitField0_ & 1) != 0) {
                    codedOutputByteBufferNano.writeUInt32(1, this.goodsId_);
                }
                String[] strArr = this.fieldValue;
                if (strArr != null && strArr.length > 0) {
                    int i10 = 0;
                    while (true) {
                        String[] strArr2 = this.fieldValue;
                        if (i10 >= strArr2.length) {
                            break;
                        }
                        String str = strArr2[i10];
                        if (str != null) {
                            codedOutputByteBufferNano.writeString(2, str);
                        }
                        i10++;
                    }
                }
                if ((this.bitField0_ & 2) != 0) {
                    codedOutputByteBufferNano.writeUInt32(3, this.exchange_);
                }
                if ((this.bitField0_ & 4) != 0) {
                    codedOutputByteBufferNano.writeUInt64(4, this.category_);
                }
                if ((this.bitField0_ & 8) != 0) {
                    codedOutputByteBufferNano.writeUInt32(5, this.tradeSession_);
                }
                super.writeTo(codedOutputByteBufferNano);
            }

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

            public ValueData 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);
                        String[] strArr = this.fieldValue;
                        int length = strArr == null ? 0 : strArr.length;
                        int i10 = repeatedFieldArrayLength + length;
                        String[] strArr2 = new String[i10];
                        if (length != 0) {
                            System.arraycopy(strArr, 0, strArr2, 0, length);
                        }
                        while (length < i10 - 1) {
                            strArr2[length] = codedInputByteBufferNano.readString();
                            codedInputByteBufferNano.readTag();
                            length++;
                        }
                        strArr2[length] = codedInputByteBufferNano.readString();
                        this.fieldValue = strArr2;
                    } else if (readTag == 24) {
                        this.exchange_ = codedInputByteBufferNano.readUInt32();
                        this.bitField0_ |= 2;
                    } else if (readTag == 32) {
                        this.category_ = codedInputByteBufferNano.readUInt64();
                        this.bitField0_ |= 4;
                    } else if (readTag == 40) {
                        this.tradeSession_ = codedInputByteBufferNano.readUInt32();
                        this.bitField0_ |= 8;
                    } else if (!WireFormatNano.parseUnknownField(codedInputByteBufferNano, readTag)) {
                        return this;
                    }
                }
            }
        }

        public SortedList_Response() {
            clear();
        }

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

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

        public SortedList_Response clear() {
            this.bitField0_ = 0;
            this.requestParams = null;
            this.valueList = ValueData.emptyArray();
            this.totalSize_ = 0;
            this.cachedSize = -1;
            return this;
        }

        public SortedList_Response clearTotalSize() {
            this.totalSize_ = 0;
            this.bitField0_ &= -2;
            return this;
        }

        /* access modifiers changed from: protected */
        public int computeSerializedSize() {
            int computeSerializedSize = super.computeSerializedSize();
            SortedListRequest.SortedList_Request sortedList_Request = this.requestParams;
            if (sortedList_Request != null) {
                computeSerializedSize += CodedOutputByteBufferNano.computeMessageSize(1, sortedList_Request);
            }
            ValueData[] valueDataArr = this.valueList;
            if (valueDataArr != null && valueDataArr.length > 0) {
                int i10 = 0;
                while (true) {
                    ValueData[] valueDataArr2 = this.valueList;
                    if (i10 >= valueDataArr2.length) {
                        break;
                    }
                    ValueData valueData = valueDataArr2[i10];
                    if (valueData != null) {
                        computeSerializedSize += CodedOutputByteBufferNano.computeMessageSize(2, valueData);
                    }
                    i10++;
                }
            }
            if ((this.bitField0_ & 1) != 0) {
                return computeSerializedSize + CodedOutputByteBufferNano.computeUInt32Size(3, this.totalSize_);
            }
            return computeSerializedSize;
        }

        public int getTotalSize() {
            return this.totalSize_;
        }

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

        public SortedList_Response setTotalSize(int i10) {
            this.totalSize_ = i10;
            this.bitField0_ |= 1;
            return this;
        }

        public void writeTo(CodedOutputByteBufferNano codedOutputByteBufferNano) throws IOException {
            SortedListRequest.SortedList_Request sortedList_Request = this.requestParams;
            if (sortedList_Request != null) {
                codedOutputByteBufferNano.writeMessage(1, sortedList_Request);
            }
            ValueData[] valueDataArr = this.valueList;
            if (valueDataArr != null && valueDataArr.length > 0) {
                int i10 = 0;
                while (true) {
                    ValueData[] valueDataArr2 = this.valueList;
                    if (i10 >= valueDataArr2.length) {
                        break;
                    }
                    ValueData valueData = valueDataArr2[i10];
                    if (valueData != null) {
                        codedOutputByteBufferNano.writeMessage(2, valueData);
                    }
                    i10++;
                }
            }
            if ((this.bitField0_ & 1) != 0) {
                codedOutputByteBufferNano.writeUInt32(3, this.totalSize_);
            }
            super.writeTo(codedOutputByteBufferNano);
        }

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

        public SortedList_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 SortedListRequest.SortedList_Request();
                    }
                    codedInputByteBufferNano.readMessage(this.requestParams);
                } else if (readTag == 18) {
                    int repeatedFieldArrayLength = WireFormatNano.getRepeatedFieldArrayLength(codedInputByteBufferNano, 18);
                    ValueData[] valueDataArr = this.valueList;
                    int length = valueDataArr == null ? 0 : valueDataArr.length;
                    int i10 = repeatedFieldArrayLength + length;
                    ValueData[] valueDataArr2 = new ValueData[i10];
                    if (length != 0) {
                        System.arraycopy(valueDataArr, 0, valueDataArr2, 0, length);
                    }
                    while (length < i10 - 1) {
                        ValueData valueData = new ValueData();
                        valueDataArr2[length] = valueData;
                        codedInputByteBufferNano.readMessage(valueData);
                        codedInputByteBufferNano.readTag();
                        length++;
                    }
                    ValueData valueData2 = new ValueData();
                    valueDataArr2[length] = valueData2;
                    codedInputByteBufferNano.readMessage(valueData2);
                    this.valueList = valueDataArr2;
                } else if (readTag == 24) {
                    this.totalSize_ = codedInputByteBufferNano.readUInt32();
                    this.bitField0_ |= 1;
                } else if (!WireFormatNano.parseUnknownField(codedInputByteBufferNano, readTag)) {
                    return this;
                }
            }
        }
    }
}
