Example usage for java.lang String equals

List of usage examples for java.lang String equals

Introduction

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

Prototype

public boolean equals(Object anObject) 

Source Link

Document

Compares this string to the specified object.

Usage

From source file:Main.java

public static boolean isDevVersion(String version) {
    return version.equals("dev-only") || version.equals("alpha-only") || version.equals("beta-only");
}

From source file:Main.java

public static int getColor(Context context, String gender) {
    return gender.equals("M") ? 0xff3D98FF : 0xffff0000;
}

From source file:Main.java

public static Boolean isPositive(String value) {
    return (value.equals("true") || value.equals("TRUE") || value.equals("yes") || value.equals("YES")
            || value.equals("enabled") || value.equals("ENABLED"));
}

From source file:Main.java

public static boolean checkNeed(String cell) {
    if (cell.equals("") || cell == null) {
        return false;
    }/*  ww w .  ja  v  a  2  s .  c  o m*/
    return true;
}

From source file:Main.java

private static boolean isInputEmpty(String input) {
    if (input.equals("")) {
        return true;
    }//from  ww  w  .j a va  2s .  c om
    return false;
}

From source file:Main.java

public static String getRealPath(String real_root, String root, String path) {
    if (path.equals(root)) {
        return real_root;
    }/*from w  w  w. jav  a 2  s. c o  m*/
    String real_path = (real_root.equals("/") ? "" : real_root)
            + path.substring(root.equals("/") ? 0 : root.length());
    return real_path;
}

From source file:Main.java

public static boolean isPic(String extension) {
    if (extension.equals("png") || extension.equals("jpg")) {
        return true;
    } else//from   w  w  w  .  j  a v  a  2  s .co m
        return false;
}

From source file:Main.java

public static int ipProtocolToInt(String proto) {
    if (proto.equals("TCP")) {
        return 6;
    } else if (proto.equals("UDP")) {
        return 17;
    }//from   www.  j av  a2  s.c o  m
    return -1;
}

From source file:Main.java

/**
 * Don't add this property if it's equal to its default value.
 *//*from  w  ww .j  a va  2s.  com*/
public static void setProperty(Properties p, String name, String value, String def) {
    if (!def.equals(value) && value != null) {
        p.setProperty(name, value);
    }
}

From source file:Main.java

public static boolean isHave(String str, String s) {
    if (s.equals("noSeparator")) {
        return false;
    } else {/* w  w  w.  j av a 2s  .c om*/
        if (str.indexOf(s) != -1) {
            return true;
        }
        return false;
    }
}