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

com.maileon.api.utils.BooleanHelper Maven / Gradle / Ivy

Go to download

Client for Customer API of Maileon. The API Documentation is avalable under https://dev.maileon.com

The newest version!
package com.maileon.api.utils;

public class BooleanHelper {

    /**
     * This method parses the String value and returns true if the value is "true", "yes" or "1" (ignoring case). null is interpreted to be false.
     *
     * @param value string representation of boolean
     * @return parsed value
     */
    public static boolean parseBoolean(String value) {
        if (value == null) {
            return false;
        }

        String compare = value.toLowerCase();
        return "true".equals(compare) || "1".equals(compare) || "yes".equals(compare);
    }

    private BooleanHelper() {
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy