package com.munjaon.client.util;

public final class ServiceUtil {
    /** DB Commit Check Counter */
    public static final int COMMIT_COUNT = 30;

    public static String[] getServiceNames(String[] serviceNames) {
        if (serviceNames == null) return null;
        for (int i = 0; i < serviceNames.length; i++) {
            serviceNames[i] = serviceNames[i].trim();
        }

        return serviceNames;
    }

    public static boolean isDuplicate(String[] serviceNames) {
        if (serviceNames == null) return false;

        boolean duplicate = false;
        for (int i = 0; i < serviceNames.length; i++) {
            for (int j = (i + 1); j < serviceNames.length; j++) {
                if (serviceNames[i].equals(serviceNames[j])) {
                    duplicate = true;
                    break;
                }
            }
            if (duplicate) break;
        }

        return duplicate;
    }
}
