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

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

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

        private static volatile BuyingSelling_Response[] _emptyArray;

        private int bitField0_;

        private int closePrice_;

        private long goodsTime_;

        public BuyingSellingRequest.BuyingSelling_Request inputParams;

        public BuyingAndSelling outputParams;

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

            private static volatile BuyingAndSelling[] _emptyArray;

            public MarketData[] buying;

            public MarketData[] selling;

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

                private static volatile MarketData[] _emptyArray;

                private int bitField0_;

                private int level_;

                private int price_;

                private long volume_;

                public MarketData() {
                    clear();
                }

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

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

                public MarketData clear() {
                    this.bitField0_ = 0;
                    this.price_ = 0;
                    this.volume_ = 0;
                    this.level_ = 0;
                    this.cachedSize = -1;
                    return this;
                }

                public MarketData clearLevel() {
                    this.level_ = 0;
                    this.bitField0_ &= -5;
                    return this;
                }

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

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

                /* access modifiers changed from: protected */
                public int computeSerializedSize() {
                    int computeSerializedSize = super.computeSerializedSize();
                    if ((this.bitField0_ & 1) != 0) {
                        computeSerializedSize += CodedOutputByteBufferNano.computeUInt32Size(1, this.price_);
                    }
                    if ((this.bitField0_ & 2) != 0) {
                        computeSerializedSize += CodedOutputByteBufferNano.computeUInt64Size(2, this.volume_);
                    }
                    if ((this.bitField0_ & 4) != 0) {
                        return computeSerializedSize + CodedOutputByteBufferNano.computeUInt32Size(3, this.level_);
                    }
                    return computeSerializedSize;
                }

                public int getLevel() {
                    return this.level_;
                }

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

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

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

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

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

                public MarketData setLevel(int i10) {
                    this.level_ = i10;
                    this.bitField0_ |= 4;
                    return this;
                }

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

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

                public void writeTo(CodedOutputByteBufferNano codedOutputByteBufferNano) throws IOException {
                    if ((this.bitField0_ & 1) != 0) {
                        codedOutputByteBufferNano.writeUInt32(1, this.price_);
                    }
                    if ((this.bitField0_ & 2) != 0) {
                        codedOutputByteBufferNano.writeUInt64(2, this.volume_);
                    }
                    if ((this.bitField0_ & 4) != 0) {
                        codedOutputByteBufferNano.writeUInt32(3, this.level_);
                    }
                    super.writeTo(codedOutputByteBufferNano);
                }

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

                public MarketData mergeFrom(CodedInputByteBufferNano codedInputByteBufferNano) throws IOException {
                    while (true) {
                        int readTag = codedInputByteBufferNano.readTag();
                        if (readTag == 0) {
                            return this;
                        }
                        if (readTag == 8) {
                            this.price_ = codedInputByteBufferNano.readUInt32();
                            this.bitField0_ |= 1;
                        } else if (readTag == 16) {
                            this.volume_ = codedInputByteBufferNano.readUInt64();
                            this.bitField0_ |= 2;
                        } else if (readTag == 24) {
                            this.level_ = codedInputByteBufferNano.readUInt32();
                            this.bitField0_ |= 4;
                        } else if (!WireFormatNano.parseUnknownField(codedInputByteBufferNano, readTag)) {
                            return this;
                        }
                    }
                }
            }

            public BuyingAndSelling() {
                clear();
            }

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

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

            public BuyingAndSelling clear() {
                this.buying = MarketData.emptyArray();
                this.selling = MarketData.emptyArray();
                this.cachedSize = -1;
                return this;
            }

            /* access modifiers changed from: protected */
            public int computeSerializedSize() {
                int computeSerializedSize = super.computeSerializedSize();
                MarketData[] marketDataArr = this.buying;
                int i10 = 0;
                if (marketDataArr != null && marketDataArr.length > 0) {
                    int i11 = 0;
                    while (true) {
                        MarketData[] marketDataArr2 = this.buying;
                        if (i11 >= marketDataArr2.length) {
                            break;
                        }
                        MarketData marketData = marketDataArr2[i11];
                        if (marketData != null) {
                            computeSerializedSize += CodedOutputByteBufferNano.computeMessageSize(1, marketData);
                        }
                        i11++;
                    }
                }
                MarketData[] marketDataArr3 = this.selling;
                if (marketDataArr3 != null && marketDataArr3.length > 0) {
                    while (true) {
                        MarketData[] marketDataArr4 = this.selling;
                        if (i10 >= marketDataArr4.length) {
                            break;
                        }
                        MarketData marketData2 = marketDataArr4[i10];
                        if (marketData2 != null) {
                            computeSerializedSize += CodedOutputByteBufferNano.computeMessageSize(2, marketData2);
                        }
                        i10++;
                    }
                }
                return computeSerializedSize;
            }

            public void writeTo(CodedOutputByteBufferNano codedOutputByteBufferNano) throws IOException {
                MarketData[] marketDataArr = this.buying;
                int i10 = 0;
                if (marketDataArr != null && marketDataArr.length > 0) {
                    int i11 = 0;
                    while (true) {
                        MarketData[] marketDataArr2 = this.buying;
                        if (i11 >= marketDataArr2.length) {
                            break;
                        }
                        MarketData marketData = marketDataArr2[i11];
                        if (marketData != null) {
                            codedOutputByteBufferNano.writeMessage(1, marketData);
                        }
                        i11++;
                    }
                }
                MarketData[] marketDataArr3 = this.selling;
                if (marketDataArr3 != null && marketDataArr3.length > 0) {
                    while (true) {
                        MarketData[] marketDataArr4 = this.selling;
                        if (i10 >= marketDataArr4.length) {
                            break;
                        }
                        MarketData marketData2 = marketDataArr4[i10];
                        if (marketData2 != null) {
                            codedOutputByteBufferNano.writeMessage(2, marketData2);
                        }
                        i10++;
                    }
                }
                super.writeTo(codedOutputByteBufferNano);
            }

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

            public BuyingAndSelling 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);
                        MarketData[] marketDataArr = this.buying;
                        int length = marketDataArr == null ? 0 : marketDataArr.length;
                        int i10 = repeatedFieldArrayLength + length;
                        MarketData[] marketDataArr2 = new MarketData[i10];
                        if (length != 0) {
                            System.arraycopy(marketDataArr, 0, marketDataArr2, 0, length);
                        }
                        while (length < i10 - 1) {
                            MarketData marketData = new MarketData();
                            marketDataArr2[length] = marketData;
                            codedInputByteBufferNano.readMessage(marketData);
                            codedInputByteBufferNano.readTag();
                            length++;
                        }
                        MarketData marketData2 = new MarketData();
                        marketDataArr2[length] = marketData2;
                        codedInputByteBufferNano.readMessage(marketData2);
                        this.buying = marketDataArr2;
                    } else if (readTag == 18) {
                        int repeatedFieldArrayLength2 = WireFormatNano.getRepeatedFieldArrayLength(codedInputByteBufferNano, 18);
                        MarketData[] marketDataArr3 = this.selling;
                        int length2 = marketDataArr3 == null ? 0 : marketDataArr3.length;
                        int i11 = repeatedFieldArrayLength2 + length2;
                        MarketData[] marketDataArr4 = new MarketData[i11];
                        if (length2 != 0) {
                            System.arraycopy(marketDataArr3, 0, marketDataArr4, 0, length2);
                        }
                        while (length2 < i11 - 1) {
                            MarketData marketData3 = new MarketData();
                            marketDataArr4[length2] = marketData3;
                            codedInputByteBufferNano.readMessage(marketData3);
                            codedInputByteBufferNano.readTag();
                            length2++;
                        }
                        MarketData marketData4 = new MarketData();
                        marketDataArr4[length2] = marketData4;
                        codedInputByteBufferNano.readMessage(marketData4);
                        this.selling = marketDataArr4;
                    } else if (!WireFormatNano.parseUnknownField(codedInputByteBufferNano, readTag)) {
                        return this;
                    }
                }
            }
        }

        public BuyingSelling_Response() {
            clear();
        }

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

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

        public BuyingSelling_Response clear() {
            this.bitField0_ = 0;
            this.inputParams = null;
            this.outputParams = null;
            this.closePrice_ = 0;
            this.goodsTime_ = 0;
            this.cachedSize = -1;
            return this;
        }

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

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

        /* access modifiers changed from: protected */
        public int computeSerializedSize() {
            int computeSerializedSize = super.computeSerializedSize();
            BuyingSellingRequest.BuyingSelling_Request buyingSelling_Request = this.inputParams;
            if (buyingSelling_Request != null) {
                computeSerializedSize += CodedOutputByteBufferNano.computeMessageSize(1, buyingSelling_Request);
            }
            BuyingAndSelling buyingAndSelling = this.outputParams;
            if (buyingAndSelling != null) {
                computeSerializedSize += CodedOutputByteBufferNano.computeMessageSize(2, buyingAndSelling);
            }
            if ((this.bitField0_ & 1) != 0) {
                computeSerializedSize += CodedOutputByteBufferNano.computeUInt32Size(3, this.closePrice_);
            }
            if ((this.bitField0_ & 2) != 0) {
                return computeSerializedSize + CodedOutputByteBufferNano.computeUInt64Size(4, this.goodsTime_);
            }
            return computeSerializedSize;
        }

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

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

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

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

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

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

        public void writeTo(CodedOutputByteBufferNano codedOutputByteBufferNano) throws IOException {
            BuyingSellingRequest.BuyingSelling_Request buyingSelling_Request = this.inputParams;
            if (buyingSelling_Request != null) {
                codedOutputByteBufferNano.writeMessage(1, buyingSelling_Request);
            }
            BuyingAndSelling buyingAndSelling = this.outputParams;
            if (buyingAndSelling != null) {
                codedOutputByteBufferNano.writeMessage(2, buyingAndSelling);
            }
            if ((this.bitField0_ & 1) != 0) {
                codedOutputByteBufferNano.writeUInt32(3, this.closePrice_);
            }
            if ((this.bitField0_ & 2) != 0) {
                codedOutputByteBufferNano.writeUInt64(4, this.goodsTime_);
            }
            super.writeTo(codedOutputByteBufferNano);
        }

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

        public BuyingSelling_Response mergeFrom(CodedInputByteBufferNano codedInputByteBufferNano) throws IOException {
            while (true) {
                int readTag = codedInputByteBufferNano.readTag();
                if (readTag == 0) {
                    return this;
                }
                if (readTag == 10) {
                    if (this.inputParams == null) {
                        this.inputParams = new BuyingSellingRequest.BuyingSelling_Request();
                    }
                    codedInputByteBufferNano.readMessage(this.inputParams);
                } else if (readTag == 18) {
                    if (this.outputParams == null) {
                        this.outputParams = new BuyingAndSelling();
                    }
                    codedInputByteBufferNano.readMessage(this.outputParams);
                } else if (readTag == 24) {
                    this.closePrice_ = codedInputByteBufferNano.readUInt32();
                    this.bitField0_ |= 1;
                } else if (readTag == 32) {
                    this.goodsTime_ = codedInputByteBufferNano.readUInt64();
                    this.bitField0_ |= 2;
                } else if (!WireFormatNano.parseUnknownField(codedInputByteBufferNano, readTag)) {
                    return this;
                }
            }
        }
    }
}
