package cn.axzo.msg.center.service.domain;

import cn.axzo.msg.center.service.domain.url.AppUrl;
import lombok.Getter;
import lombok.Setter;

/**
 * @author yanglin
 */
@Setter
@Getter
public class MobileUrlConfig {

    /**
     * ios的url配置
     */
    private AppUrl ios;

    /**
     * android的url配置
     */
    private AppUrl android;

    public boolean hasUrl() {
        return ios != null && ios.hasUrl() || android != null && android.hasUrl();
    }

    public void setFieldsNullIfUrlAbsent() {
        if (ios != null && !ios.hasUrl())
            ios = null;
        if (android != null && !android.hasUrl())
            android = null;
    }
}