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:Main.java

private static boolean isContentNode(String nodeName) {
    for (String sel : CONTENT_NODE) {
        if (nodeName.equalsIgnoreCase(sel))
            return true;
    }//from   w w w. j a  v a2  s .  c o  m
    return false;
}

From source file:neembuu.uploader.versioning.CheckUser.java

private static boolean findBooleanValue(String name) {
    return ((name == null) || !name.equalsIgnoreCase("false"));
}

From source file:Main.java

public static boolean matches(String s, String[] pattern) {
    for (int i = 0; i < pattern.length; i++) {
        if (s.equalsIgnoreCase(pattern[i]))
            return true;
    }/*  ww w. j a  v a2s  .c o m*/
    return false;
}

From source file:Main.java

public static void setLocale(String lang, Resources res) {
    Locale myLocale;/*from   ww w .  j a  v a  2 s .  c o  m*/
    if (lang.equalsIgnoreCase("zh-rTW")) {
        myLocale = Locale.TRADITIONAL_CHINESE;
    } else if (lang.equalsIgnoreCase("zh-rCN") || lang.equalsIgnoreCase("zh")) {
        myLocale = Locale.SIMPLIFIED_CHINESE;
    } else if (lang.equalsIgnoreCase("pt-rBR") || lang.equalsIgnoreCase("pt")) {
        myLocale = new Locale("pt", "BR");
    } else if (lang.equalsIgnoreCase("pt-rPT")) {
        myLocale = new Locale("pt", "PT");
    } else {
        myLocale = new Locale(lang);
    }
    DisplayMetrics dm = res.getDisplayMetrics();
    Configuration conf = res.getConfiguration();
    conf.locale = myLocale;
    res.updateConfiguration(conf, dm);
}

From source file:Main.java

/**
 * Returns the first codec capable of encoding the specified MIME type, or null if no
 * match was found.//from  w w  w  .  j  a v a2  s . c  o  m
 *
 * @param mimeType String
 * @return MediaCodecInfo
 */
public static MediaCodecInfo selectCodec(String mimeType) {
    int numCodecs = MediaCodecList.getCodecCount();
    for (int i = 0; i < numCodecs; i++) {
        MediaCodecInfo codecInfo = MediaCodecList.getCodecInfoAt(i);
        if (!codecInfo.isEncoder()) {
            continue;
        }
        String[] types = codecInfo.getSupportedTypes();
        for (String type : types) {
            if (type.equalsIgnoreCase(mimeType)) {
                return codecInfo;
            }
        }
    }
    return null;
}

From source file:Main.java

public static boolean isMiBox2Device() {
    String manufacturer = Build.MANUFACTURER;
    String productName = Build.PRODUCT;
    return manufacturer.equalsIgnoreCase("Xiaomi") && productName.equalsIgnoreCase("dredd");
}

From source file:Main.java

public static boolean equalsIgnoreCase(String str1, String str2) {
    return str1 != null && str2 != null && str1.equalsIgnoreCase(str2);
}

From source file:libra.preprocess.Preprocessor.java

private static int checkRunStages(String[] args) {
    int runStages = 0;
    for (String arg : args) {
        if (arg.equalsIgnoreCase("stage1")) {
            runStages |= RUN_STAGE_1;/* w w  w .  j  a va 2  s. c o  m*/
        } else if (arg.equalsIgnoreCase("stage2")) {
            runStages |= RUN_STAGE_2;
        }
    }

    if (runStages == 0) {
        runStages |= RUN_STAGE_1;
        runStages |= RUN_STAGE_2;
    }
    return runStages;
}

From source file:Main.java

private static boolean isCode(String ext) {
    for (String s : CODE_EXTENSIONS) {
        if (s.equalsIgnoreCase(ext))
            return true;
    }// ww  w.  j a v  a  2s .  co m
    return false;
}

From source file:Main.java

public static InputStream getInputEncoding(URLConnection connection) throws IOException {
    InputStream in;// ww  w .  ja v  a2 s  . co  m
    String encoding = connection.getContentEncoding();
    if (encoding != null && encoding.equalsIgnoreCase("gzip")) {
        in = new GZIPInputStream(connection.getInputStream());
    } else if (encoding != null && encoding.equalsIgnoreCase("deflate")) {
        in = new InflaterInputStream(connection.getInputStream(), new Inflater(true));
    } else {
        in = connection.getInputStream();
    }
    return in;
}