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:it.smartcommunitylab.aac.oauth.AACOAuth2Utils.java

/**
 * Generates the code challenge from a given code verifier and code challenge method.
 * @param codeVerifier/*  w  w w .j a va  2  s.  c om*/
 * @param codeChallengeMethod allowed values are only <code>plain</code> and <code>S256</code>
 * @return
 */
public static String getCodeChallenge(String codeVerifier, String codeChallengeMethod) {
    if (codeChallengeMethod.equals("plain")) {
        return codeVerifier;
    } else if (codeChallengeMethod.equalsIgnoreCase("S256")) {
        return getS256CodeChallenge(codeVerifier);
    } else {
        throw new IllegalArgumentException(codeChallengeMethod + " is not a supported code challenge method.");
    }
}

From source file:bridgempp.GroupManager.java

public static Group findGroup(String name) {
    for (int i = 0; i < groups.size(); i++) {
        String groupname = groups.get(i).getName();
        if (groupname != null && groupname.equalsIgnoreCase(name)) {
            return groups.get(i);
        }/*from   w w  w .j a v  a2 s  .co m*/
    }
    return null;
}

From source file:Main.java

/**
 * Same as wsubstrn, but without a specified length.
 * @param s1 full String//from ww  w  .  ja  va 2  s  . co  m
 * @param s2 String to search for
 * @return <code>true</code> if s2 is found in s2 (case insensitive search)
 */
static boolean wsubstr(String s1, String s2) {
    int i;
    int len1 = s1.length();
    int len2 = s2.length();

    for (i = 0; i <= len1 - len2; ++i) {
        if (s2.equalsIgnoreCase(s1.substring(i))) {
            return true;
        }
    }

    return false;
}

From source file:org.openfaces.component.chart.impl.PropertiesConverter.java

public static Stroke toStroke(StyleBorderModel border) {
    Stroke stroke = null;/*from   w w w.  j  av a 2 s.  c o m*/

    if (border != null) {
        int width = border.getWidth();
        String style = border.getStyle();

        if (style.equalsIgnoreCase("DASHED")) {
            float[] dash = { width * 4 };
            stroke = new BasicStroke(width, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, width * 3, dash, 1F);
        } else if (style.equalsIgnoreCase("DOTTED")) {
            float[] dash = { width };
            stroke = new BasicStroke(width, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, width * 3, dash, 1F);
        } else {
            stroke = new BasicStroke(width);
        }
    }
    return stroke;
}

From source file:org.prx.playerhater.util.PlaylistParser.java

public static Uri[] parsePlaylist(Uri uri) {
    try {/*from  w  w w.  j a  va 2s .  c  o m*/
        HttpClient httpclient = new DefaultHttpClient();
        HttpResponse response = httpclient.execute(new HttpHead(uri.toString()));
        Header contentType = response.getEntity().getContentType();
        if (contentType != null) {
            String mimeType = contentType.getValue().split(";")[0].trim();

            for (String plsMimeType : PLS_MIME_TYPES) {
                if (plsMimeType.equalsIgnoreCase(mimeType)) {
                    return parsePls(uri);
                }
            }

            for (String m3uMimeType : M3U_MIME_TYPES) {
                if (m3uMimeType.equalsIgnoreCase(mimeType)) {
                    return parseM3u(uri);
                }
            }
        }
    } catch (Exception e) {
    }
    return new Uri[] { uri };
}

From source file:com.wso2telco.dep.mediator.impl.payment.PaymentUtil.java

public static void validatePaymentCategory(JSONObject chargingdmeta, List<String> lstCategories)
        throws JSONException {
    boolean isvalid = false;
    String chargeCategory = "";
    if ((!chargingdmeta.isNull("purchaseCategoryCode"))
            && (!chargingdmeta.getString("purchaseCategoryCode").isEmpty())) {

        chargeCategory = chargingdmeta.getString("purchaseCategoryCode");
        for (String d : lstCategories) {
            if (d.equalsIgnoreCase(chargeCategory)) {
                isvalid = true;/*  w  w  w .  j  a v  a 2s .  c  o  m*/
                break;
            }
        }
    } else {
        isvalid = true;
    }

    if (!isvalid) {
        throw new CustomException("POL0001", "A policy error occurred. Error code is %1",
                new String[] { "Invalid " + "purchaseCategoryCode : " + chargeCategory });
    }
}

From source file:de.tudarmstadt.ukp.csniper.webapp.support.uima.AnalysisEngineFactory.java

private static Object convert(Object aValue) {
    if (aValue instanceof String) {
        String aString = (String) aValue;
        if (aString.equalsIgnoreCase("true")) {
            return true;
        } else if (aString.equalsIgnoreCase("false")) {
            return false;
        } else {//from  w w w  .ja  v  a  2s  .c o m
            try {
                return Integer.parseInt(aString);
            } catch (NumberFormatException e) {
                return aValue;
            }
        }
    } else {
        return aValue;
    }
}

From source file:com.magnet.plugin.helpers.VerifyHelper.java

private static String verify(String name, String regExp, boolean isUpper) {
    name = name.replaceAll(regExp, "");
    if (!name.equalsIgnoreCase("")) {
        if (isUpper) {
            name = name.substring(0, 1).toUpperCase() + name.substring(1);
        } else {//from   www  .  j ava2  s  . c  om
            name = name.substring(0, 1).toLowerCase() + name.substring(1);
        }
    }
    name = verifyByKeyWords(name);
    return name;
}

From source file:com.dropbox.presto.kafka.KafkaTableHandle.java

public static boolean kafkaTableMarkPresent(Map<String, String> props) {
    String kafkaMark = props.get(KafkaTableProperties.kafkaTableMarker);
    return kafkaMark != null && kafkaMark.equalsIgnoreCase("true");
}

From source file:com.game.network.toolbox.HttpHeaderParser.java

/**
 * Returns the charset specified in the Content-Type of this header,
 * or the HTTP default (ISO-8859-1) if none can be found.
 *//*www.j av  a2 s . c om*/
public static String parseCharset(Map<String, String> headers) {
    String contentType = headers.get(HTTP.CONTENT_TYPE);
    if (contentType != null) {
        String[] params = contentType.split(";");
        for (int i = 1; i < params.length; i++) {
            String[] pair = params[i].trim().split("=");
            if (pair.length == 2) {
                if (pair[0].equals("charset")) {
                    String code = pair[1];
                    if (code.equalsIgnoreCase("ISO-88509-1")) {
                        return "UTF-8";
                    }
                    return pair[1];
                }
            }
        }
    }

    return HTTP.DEFAULT_CONTENT_CHARSET;
}