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

io.lsn.java.common.helper.BooleanHelper Maven / Gradle / Ivy

package io.lsn.java.common.helper;

import java.util.Arrays;

/**
 * @author Patryk Szlagowski 
 */
public class BooleanHelper {

    /**
     * try to map logic string to Boolean value:
     * x, 1, ok, yes, y
     *
     * @param in
     * @return
     */
    public static Boolean mapLogicString(String in) {
        if (in == null || in.trim().isEmpty()) {
            return null;
        }
        return Arrays.asList("x", "1", "ok", "yes", "y").contains(in);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy