package com.ruoyi.web.modules.farming.support;

/**
 * 科技服务人员管理业务规则。
 */
public final class TechServicePersonnelRules
{
    public static final long SINGLETON_ID = 1L;

    private TechServicePersonnelRules()
    {
    }

    public static Integer sumNullable(Integer... values)
    {
        if (values == null || values.length == 0)
        {
            return null;
        }
        boolean any = false;
        int sum = 0;
        for (Integer v : values)
        {
            if (v != null)
            {
                any = true;
                sum += v;
            }
        }
        return any ? sum : null;
    }

    public static boolean isNonNegative(Integer value)
    {
        return value == null || value >= 0;
    }
}
