Example usage for java.lang String equalsIgnoreCase

List of usage examples for java.lang String equalsIgnoreCase

Introduction

In this page you can find the example usage for java.lang String equalsIgnoreCase.

Prototype

public boolean equalsIgnoreCase(String anotherString) 

Source Link

Document

Compares this String to another String , ignoring case considerations.

Usage

From source file:ml.shifu.shifu.core.pmml.PMMLUtils.java

public static Model createModelByType(String name) {
    if (name.equalsIgnoreCase("NeuralNetwork")) {
        return new NeuralNetwork();
    } else {//from  w ww  .ja v  a 2 s. c  o  m
        throw new RuntimeException("Model not supported: " + name);
    }

}

From source file:com.thoughtworks.go.i18n.LocalizedMessage.java

public static String tooltipDefaultTarget(String toolName) {
    if (toolName.equalsIgnoreCase("ANT")) {
        return "Ant target(s) to run. If not specified, the target defaults to 'default'.";
    }/*from  www.  j av  a2 s.com*/
    if (toolName.equalsIgnoreCase("NANT")) {
        return "NAnt target(s) to run. If not specified, defaults to the default target of the build file.";
    }
    if (toolName.equalsIgnoreCase("RAKE")) {
        return "Path to Rake file. If not specified, the path defaults to 'rakefile'.";
    }
    throw new IllegalArgumentException("Unknown tool name " + toolName);
}

From source file:at.bitfire.davdroid.DateUtils.java

public static String findAndroidTimezoneID(String tz) {
    String deviceTZ = null;//  w w  w .jav  a2 s. c om
    String availableTZs[] = SimpleTimeZone.getAvailableIDs();

    // first, try to find an exact match (case insensitive)
    for (String availableTZ : availableTZs)
        if (availableTZ.equalsIgnoreCase(tz)) {
            deviceTZ = availableTZ;
            break;
        }

    // if that doesn't work, try to find something else that matches
    if (deviceTZ == null) {
        Log.w(TAG, "Coulnd't find time zone with matching identifiers, trying to guess");
        for (String availableTZ : availableTZs)
            if (StringUtils.indexOfIgnoreCase(tz, availableTZ) != -1) {
                deviceTZ = availableTZ;
                break;
            }
    }

    // if that doesn't work, use UTC as fallback
    if (deviceTZ == null) {
        final String defaultTZ = TimeZone.getDefault().getID();
        Log.e(TAG, "Couldn't identify time zone, using system default (" + defaultTZ + ") as fallback");
        deviceTZ = defaultTZ;
    }

    return deviceTZ;
}

From source file:com.thoughtworks.go.i18n.LocalizedMessage.java

public static String tooltipBuildFilePath(String toolName) {
    if (toolName.equalsIgnoreCase("ANT")) {
        return "Path to Ant build file. If not specified, the path defaults to 'build.xml'.";
    }/*  w  w w.j  av  a  2  s .  c o  m*/
    if (toolName.equalsIgnoreCase("NANT")) {
        return "Relative path to a NAnt build file. If not specified, the path defaults to 'default.build'.";
    }
    if (toolName.equalsIgnoreCase("RAKE")) {
        return "Path to Rake file. If not specified, the path defaults to 'rakefile'.";
    }

    throw new IllegalArgumentException("Unknown tool name " + toolName);
}

From source file:com.flexive.shared.cmis.CmisVirtualProperty.java

/**
 * Returns the CmisVirtualProperty for the given [fleXive] property name, or null if none was found.
 *
 * @param fxPropertyName the [fleXive] property name (e.g. "typdef")
 * @return  the CmisVirtualProperty for the given property name, or null if none was found.
 *//*from www .j a  v  a  2  s .com*/
public static CmisVirtualProperty getByFlexiveName(String fxPropertyName) {
    for (CmisVirtualProperty property : values()) {
        if (fxPropertyName.equalsIgnoreCase(property.getFxPropertyName())) {
            return property;
        }
    }
    return null;
}

From source file:com.photon.phresco.framework.win8.util.Win8MetroCofigFileParser.java

private static void findChild(Element rootNamespace, ApplicationInfo info, Namespace ns) {
    String name = rootNamespace.getName();
    if (name.equalsIgnoreCase(ROOTNAMESPACE)) {
        rootNamespace.setText(info.getName());
    } else if (name.equalsIgnoreCase(ASSEMBLY_NAME)) {
        rootNamespace.setText(info.getName());
    } else if (name.equalsIgnoreCase(CERTIFACTE_KEY)) {
        rootNamespace.setText(info.getName() + TEMPORARY_KEY);
    } else if (name.equalsIgnoreCase(NONE)) {
        Attribute attribute = rootNamespace.getAttribute(Constants.INCLUDE);
        attribute.setValue(info.getName() + TEMPORARY_KEY);
    }/* w  w  w  .  j a  v a  2 s.  c  o  m*/
}

From source file:org.kmnet.com.fw.web.util.JspTagUtils.java

/**
 * Convert to the Boolean value./*from   w w  w .  ja  va 2  s.c  o m*/
 * @param attributeValue string value of attribute
 * @param defaultValue If attribute value is not text(null or blank or whitespace only), apply this value.
 * @param attributeName attribute name (If attribute value is not true or false, sets in exception message)
 * @return converted Boolean value
 * @throws JspTagException If value that is not true or false is specified.
 */
public static boolean toBoolean(String attributeValue, boolean defaultValue, String attributeName)
        throws JspTagException {
    if (StringUtils.hasText(attributeValue)) {
        if (attributeValue.equalsIgnoreCase("true") || attributeValue.equalsIgnoreCase("false")) {
            return Boolean.parseBoolean(attributeValue);
        } else {
            throw new JspTagException("The value of " + attributeName + " must be either true or false.");
        }
    }
    return defaultValue;
}

From source file:de.rallye.push.PushService.java

public static IPushAdapter getPushAdapter(String name, IDataAdapter data, RallyeConfig config) {
    if (name.equalsIgnoreCase("gcm"))
        return new GCMPushAdapter(config.getGcmApiKey(), data);
    if (name.equalsIgnoreCase("websocket"))
        return PushWebsocketApp.getInstance();
    else/*from  w ww  .  j av a  2 s.  c om*/
        return null;
}

From source file:Main.java

/** Returns the consumer friendly device name */
public static String getDeviceName() {
    final String manufacturer = Build.MANUFACTURER;
    final String model = Build.MODEL;
    if (model.startsWith(manufacturer)) {
        return capitalize(model);
    }/*ww  w .ja va 2s . c  o m*/
    if (manufacturer.equalsIgnoreCase("HTC")) {
        // make sure "HTC" is fully capitalized.
        return "HTC " + model;
    }
    return capitalize(manufacturer) + " " + model;
}

From source file:com.antsdb.saltedfish.sql.mysql.Utils.java

private static void setColumnDefault(ColumnAttributes attrs, Column_constraint_defaultContext rule) {
    if (rule.literal_value() != null) {
        String value = rule.literal_value().getText();
        if (value.equalsIgnoreCase("null")) {
            attrs.setDefaultValue(null);
        } else {/*from  w w w. ja  va  2s.  c  o m*/
            attrs.setDefaultValue(value);
        }
    } else if (rule.signed_number() != null) {
        attrs.setDefaultValue(rule.signed_number().getText());
    } else {
        throw new NotImplementedException();
    }
}