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

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

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

        private static volatile SetGoodsRecord_Response[] _emptyArray;

        public SetGoodsRecordRequest.SetGoodsRecord_Request input;

        public SetGoodsRecordRequest.SetGoodsRecord_Request.RecordDetail[] output;

        public SetGoodsRecord_Response() {
            clear();
        }

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

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

        public SetGoodsRecord_Response clear() {
            this.input = null;
            this.output = SetGoodsRecordRequest.SetGoodsRecord_Request.RecordDetail.emptyArray();
            this.cachedSize = -1;
            return this;
        }

        /* access modifiers changed from: protected */
        public int computeSerializedSize() {
            int computeSerializedSize = super.computeSerializedSize();
            SetGoodsRecordRequest.SetGoodsRecord_Request setGoodsRecord_Request = this.input;
            if (setGoodsRecord_Request != null) {
                computeSerializedSize += CodedOutputByteBufferNano.computeMessageSize(1, setGoodsRecord_Request);
            }
            SetGoodsRecordRequest.SetGoodsRecord_Request.RecordDetail[] recordDetailArr = this.output;
            if (recordDetailArr != null && recordDetailArr.length > 0) {
                int i10 = 0;
                while (true) {
                    SetGoodsRecordRequest.SetGoodsRecord_Request.RecordDetail[] recordDetailArr2 = this.output;
                    if (i10 >= recordDetailArr2.length) {
                        break;
                    }
                    SetGoodsRecordRequest.SetGoodsRecord_Request.RecordDetail recordDetail = recordDetailArr2[i10];
                    if (recordDetail != null) {
                        computeSerializedSize += CodedOutputByteBufferNano.computeMessageSize(2, recordDetail);
                    }
                    i10++;
                }
            }
            return computeSerializedSize;
        }

        public void writeTo(CodedOutputByteBufferNano codedOutputByteBufferNano) throws IOException {
            SetGoodsRecordRequest.SetGoodsRecord_Request setGoodsRecord_Request = this.input;
            if (setGoodsRecord_Request != null) {
                codedOutputByteBufferNano.writeMessage(1, setGoodsRecord_Request);
            }
            SetGoodsRecordRequest.SetGoodsRecord_Request.RecordDetail[] recordDetailArr = this.output;
            if (recordDetailArr != null && recordDetailArr.length > 0) {
                int i10 = 0;
                while (true) {
                    SetGoodsRecordRequest.SetGoodsRecord_Request.RecordDetail[] recordDetailArr2 = this.output;
                    if (i10 >= recordDetailArr2.length) {
                        break;
                    }
                    SetGoodsRecordRequest.SetGoodsRecord_Request.RecordDetail recordDetail = recordDetailArr2[i10];
                    if (recordDetail != null) {
                        codedOutputByteBufferNano.writeMessage(2, recordDetail);
                    }
                    i10++;
                }
            }
            super.writeTo(codedOutputByteBufferNano);
        }

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

        public SetGoodsRecord_Response mergeFrom(CodedInputByteBufferNano codedInputByteBufferNano) throws IOException {
            while (true) {
                int readTag = codedInputByteBufferNano.readTag();
                if (readTag == 0) {
                    return this;
                }
                if (readTag == 10) {
                    if (this.input == null) {
                        this.input = new SetGoodsRecordRequest.SetGoodsRecord_Request();
                    }
                    codedInputByteBufferNano.readMessage(this.input);
                } else if (readTag == 18) {
                    int repeatedFieldArrayLength = WireFormatNano.getRepeatedFieldArrayLength(codedInputByteBufferNano, 18);
                    SetGoodsRecordRequest.SetGoodsRecord_Request.RecordDetail[] recordDetailArr = this.output;
                    int length = recordDetailArr == null ? 0 : recordDetailArr.length;
                    int i10 = repeatedFieldArrayLength + length;
                    SetGoodsRecordRequest.SetGoodsRecord_Request.RecordDetail[] recordDetailArr2 = new SetGoodsRecordRequest.SetGoodsRecord_Request.RecordDetail[i10];
                    if (length != 0) {
                        System.arraycopy(recordDetailArr, 0, recordDetailArr2, 0, length);
                    }
                    while (length < i10 - 1) {
                        SetGoodsRecordRequest.SetGoodsRecord_Request.RecordDetail recordDetail = new SetGoodsRecordRequest.SetGoodsRecord_Request.RecordDetail();
                        recordDetailArr2[length] = recordDetail;
                        codedInputByteBufferNano.readMessage(recordDetail);
                        codedInputByteBufferNano.readTag();
                        length++;
                    }
                    SetGoodsRecordRequest.SetGoodsRecord_Request.RecordDetail recordDetail2 = new SetGoodsRecordRequest.SetGoodsRecord_Request.RecordDetail();
                    recordDetailArr2[length] = recordDetail2;
                    codedInputByteBufferNano.readMessage(recordDetail2);
                    this.output = recordDetailArr2;
                } else if (!WireFormatNano.parseUnknownField(codedInputByteBufferNano, readTag)) {
                    return this;
                }
            }
        }
    }
}
