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:com.googlecode.jtiger.modules.ecside.view.html.BuilderUtils.java

public static boolean showPagination(TableModel model) {
    String showToolBar = model.getTable().getToolbarLocation();
    return showToolBar != null && showToolBar.length() > 0 && !showToolBar.equalsIgnoreCase("none")
            && !showToolBar.equalsIgnoreCase("null") && !showToolBar.equalsIgnoreCase("false");
}

From source file:com.rjuarez.webapp.tools.MethodSub.java

public static MethodSub fromString(final String value) {
    if (StringUtils.isNotBlank(value)) {
        for (final MethodSub method : EnumSet.allOf(MethodSub.class)) {
            if (value.equalsIgnoreCase(method.value)) {
                return method;
            }/* ww  w.  j  a  v a  2s.  c o m*/
        }
    }

    // We've not found the type!
    throw new IllegalArgumentException("Method '" + value + "' not recognised");
}

From source file:JDOMUtil.java

/****************************************************************************/

public static String getDefaultValueForType(String dataType) {
    if (dataType == null)
        return "null";
    else if (dataType.equalsIgnoreCase("boolean"))
        return "false";
    else if (dataType.equalsIgnoreCase("string"))
        return "";
    else//from  w  w w.j  a  v a 2 s  .c o  m
        return "0";
}

From source file:com.gson.oauth.Pay.java

/**
 * ??/*w  w w.j  a va 2s .  c o m*/
 * @param timestamp
 * @param noncestr
 * @param openid
 * @param issubscribe
 * @param appsignature
 * @return
 * @throws UnsupportedEncodingException 
 */
public static boolean verifySign(long timestamp, String noncestr, String openid, int issubscribe,
        String appsignature) throws UnsupportedEncodingException {
    Map<String, String> paras = new HashMap<String, String>();
    paras.put("appid", ConfKit.get("AppId"));
    paras.put("appkey", ConfKit.get("paySignKey"));
    paras.put("timestamp", String.valueOf(timestamp));
    paras.put("noncestr", noncestr);
    paras.put("openid", openid);
    paras.put("issubscribe", String.valueOf(issubscribe));
    // appid?appkey?productid?timestamp?noncestr?openid?issubscribe
    String string1 = createSign(paras, false);
    String paySign = DigestUtils.shaHex(string1);
    return paySign.equalsIgnoreCase(appsignature);
}

From source file:com.moviejukebox.model.enumerations.WatchedWithLocation.java

/**
 * Convert a string into an Enum type/*from  w  ww. j  av a  2 s.co m*/
 *
 * @param location
 * @return
 * @throws IllegalArgumentException If type is not recognised
 *
 */
public static WatchedWithLocation fromString(String location) {
    if (StringUtils.isNotBlank(location)) {
        for (final WatchedWithLocation withLocation : EnumSet.allOf(WatchedWithLocation.class)) {
            if (location.equalsIgnoreCase(withLocation.toString())) {
                return withLocation;
            }
        }
    }
    // We've not found the type, so reutrn CUSTOM
    return CUSTOM;
}

From source file:com.omertron.omdbapi.tools.Param.java

/**
 * Convert a string into an Enum type/*from  w w  w. j  a  va 2s  .  c o  m*/
 *
 * @param value
 * @return
 */
public static Param fromString(String value) {
    if (StringUtils.isNotBlank(value)) {
        for (final Param param : EnumSet.allOf(Param.class)) {
            if (value.equalsIgnoreCase(param.value)) {
                return param;
            }
        }
    }

    // We've not found the type!
    throw new IllegalArgumentException("Value '" + value + "' not recognised");
}

From source file:is.landsbokasafn.deduplicator.indexer.IndexingLauncher.java

private static boolean readBooleanConfig(String propertyName, boolean fallback) {
    String prop = System.getProperty(propertyName);
    if (prop == null) {
        return fallback;
    }//from w w  w .  j  a v a 2 s .c o m
    return prop.equalsIgnoreCase("true");
}

From source file:Main.java

static public boolean containsCaseInsensitive(Collection<String> items, final String queryItem)
        throws IllegalArgumentException {

    if (items == null || queryItem == null) {
        throw new IllegalArgumentException();
    }//w  w w. j a va  2  s.c o  m

    for (String item : items) {
        if (queryItem.equalsIgnoreCase(item)) {
            return true;
        }
    }

    return false;
}

From source file:com.ebay.myriad.scheduler.SchedulerUtils.java

public static boolean isUniqueHostname(Offer offer, Collection<NodeTask> tasks) {
    Preconditions.checkArgument(offer != null);
    String offerHostname = offer.getHostname();

    if (CollectionUtils.isEmpty(tasks)) {
        return true;
    }//w w w. java  2s. c o m

    boolean uniqueHostname = tasks.stream().filter(task -> offerHostname.equalsIgnoreCase(task.getHostname()))
            .count() == 0;
    LOGGER.info("Offer's hostname {} is unique: {}", offerHostname, uniqueHostname);
    return uniqueHostname;
}

From source file:com.rjuarez.webapp.tools.TheMovieDatabaseMethod.java

/**
 * Convert a string into an Enum type//from  w w w . j  a v a 2 s  .co m
 *
 * @param value
 * @return
 */
public static TheMovieDatabaseMethod fromString(final String value) {
    if (StringUtils.isNotBlank(value)) {
        for (final TheMovieDatabaseMethod method : EnumSet.allOf(TheMovieDatabaseMethod.class)) {
            if (value.equalsIgnoreCase(method.value)) {
                return method;
            }
        }
    }

    // We've not found the type!
    throw new IllegalArgumentException("Method '" + value + "' not recognised");
}