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.GetGoodsGroupResponse;
import nano.SetGoodsGroupRequest;

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

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

        private static volatile SetGoodsGroup_Response[] _emptyArray;

        public GetGoodsGroupResponse.GetGoodsGroup_Response.GroupDetail[] group;

        public SetGoodsGroupRequest.SetGoodsGroup_Request input;

        public SetGoodsGroup_Response() {
            clear();
        }

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

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

        public SetGoodsGroup_Response clear() {
            this.input = null;
            this.group = GetGoodsGroupResponse.GetGoodsGroup_Response.GroupDetail.emptyArray();
            this.cachedSize = -1;
            return this;
        }

        /* access modifiers changed from: protected */
        public int computeSerializedSize() {
            int computeSerializedSize = super.computeSerializedSize();
            SetGoodsGroupRequest.SetGoodsGroup_Request setGoodsGroup_Request = this.input;
            if (setGoodsGroup_Request != null) {
                computeSerializedSize += CodedOutputByteBufferNano.computeMessageSize(1, setGoodsGroup_Request);
            }
            GetGoodsGroupResponse.GetGoodsGroup_Response.GroupDetail[] groupDetailArr = this.group;
            if (groupDetailArr != null && groupDetailArr.length > 0) {
                int i10 = 0;
                while (true) {
                    GetGoodsGroupResponse.GetGoodsGroup_Response.GroupDetail[] groupDetailArr2 = this.group;
                    if (i10 >= groupDetailArr2.length) {
                        break;
                    }
                    GetGoodsGroupResponse.GetGoodsGroup_Response.GroupDetail groupDetail = groupDetailArr2[i10];
                    if (groupDetail != null) {
                        computeSerializedSize += CodedOutputByteBufferNano.computeMessageSize(2, groupDetail);
                    }
                    i10++;
                }
            }
            return computeSerializedSize;
        }

        public void writeTo(CodedOutputByteBufferNano codedOutputByteBufferNano) throws IOException {
            SetGoodsGroupRequest.SetGoodsGroup_Request setGoodsGroup_Request = this.input;
            if (setGoodsGroup_Request != null) {
                codedOutputByteBufferNano.writeMessage(1, setGoodsGroup_Request);
            }
            GetGoodsGroupResponse.GetGoodsGroup_Response.GroupDetail[] groupDetailArr = this.group;
            if (groupDetailArr != null && groupDetailArr.length > 0) {
                int i10 = 0;
                while (true) {
                    GetGoodsGroupResponse.GetGoodsGroup_Response.GroupDetail[] groupDetailArr2 = this.group;
                    if (i10 >= groupDetailArr2.length) {
                        break;
                    }
                    GetGoodsGroupResponse.GetGoodsGroup_Response.GroupDetail groupDetail = groupDetailArr2[i10];
                    if (groupDetail != null) {
                        codedOutputByteBufferNano.writeMessage(2, groupDetail);
                    }
                    i10++;
                }
            }
            super.writeTo(codedOutputByteBufferNano);
        }

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

        public SetGoodsGroup_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 SetGoodsGroupRequest.SetGoodsGroup_Request();
                    }
                    codedInputByteBufferNano.readMessage(this.input);
                } else if (readTag == 18) {
                    int repeatedFieldArrayLength = WireFormatNano.getRepeatedFieldArrayLength(codedInputByteBufferNano, 18);
                    GetGoodsGroupResponse.GetGoodsGroup_Response.GroupDetail[] groupDetailArr = this.group;
                    int length = groupDetailArr == null ? 0 : groupDetailArr.length;
                    int i10 = repeatedFieldArrayLength + length;
                    GetGoodsGroupResponse.GetGoodsGroup_Response.GroupDetail[] groupDetailArr2 = new GetGoodsGroupResponse.GetGoodsGroup_Response.GroupDetail[i10];
                    if (length != 0) {
                        System.arraycopy(groupDetailArr, 0, groupDetailArr2, 0, length);
                    }
                    while (length < i10 - 1) {
                        GetGoodsGroupResponse.GetGoodsGroup_Response.GroupDetail groupDetail = new GetGoodsGroupResponse.GetGoodsGroup_Response.GroupDetail();
                        groupDetailArr2[length] = groupDetail;
                        codedInputByteBufferNano.readMessage(groupDetail);
                        codedInputByteBufferNano.readTag();
                        length++;
                    }
                    GetGoodsGroupResponse.GetGoodsGroup_Response.GroupDetail groupDetail2 = new GetGoodsGroupResponse.GetGoodsGroup_Response.GroupDetail();
                    groupDetailArr2[length] = groupDetail2;
                    codedInputByteBufferNano.readMessage(groupDetail2);
                    this.group = groupDetailArr2;
                } else if (!WireFormatNano.parseUnknownField(codedInputByteBufferNano, readTag)) {
                    return this;
                }
            }
        }
    }
}
