package com.ss.android.ugc.aweme.ecommerce.combinepayment.ordersubmit.repository.dto;

import X.2sH;
import X.C5258Bwk;
import X.C5E;
import X.M12;
import com.bytedance.covode.number.Covode;
import java.io.Serializable;

public final class BillInfoResponse extends C5E<BillInfoData> implements Serializable {
    public static final C5258Bwk Companion = new C5258Bwk((byte) 0);

    static {
        Covode.recordClassIndex(68968);
    }

    public final String toJson() {
        String LIZ = 2sH.LIZ.LIZ(this);
        if (LIZ == null) {
            return "{}";
        }
        return LIZ;
    }

    public final boolean isValid() {
        if (!isCodeOK() || this.data == null || ((BillInfoData) this.data).isEmpty()) {
            return false;
        }
        return true;
    }

    public final BillInfoResponse merge(BillInfoResponse billInfoResponse, BillInfoRequest billInfoRequest) {
        BillInfoData billInfoData;
        M12.LIZ(billInfoResponse, billInfoRequest);
        int i = this.code;
        String str = this.message;
        BillInfoData billInfoData2 = (BillInfoData) this.data;
        if (billInfoData2 != null) {
            billInfoData = billInfoData2.merge((BillInfoData) billInfoResponse.data, billInfoRequest);
        } else {
            billInfoData = null;
        }
        return new BillInfoResponse(i, str, billInfoData);
    }

    public BillInfoResponse(int i, String str, BillInfoData billInfoData) {
        super(i, str, billInfoData);
    }
}
