All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sitoolkit.wt.gui.infra.util.StrUtils Maven / Gradle / Ivy

There is a newer version: 2.3
Show newest version
package org.sitoolkit.wt.gui.infra.util;

import java.util.Collection;

public class StrUtils {

    public static String join(Collection objects) {

        if (objects == null || objects.isEmpty()) {
            return "";
        }

        StringBuilder sb = new StringBuilder();

        for (Object str : objects) {

            if (sb.length() > 0) {
                sb.append(",");
            }
            sb.append(str);

        }

        return sb.toString();
    }

    public static boolean isEmpty(String str) {
        return str == null || str.isEmpty();
    }

    public static boolean isNotEmpty(String str) {
        return !isEmpty(str);
    }

    public static boolean equals(String a, String b) {
        return a == null ? b == null : a.equals(b);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy