List of usage examples for org.apache.commons.lang StringUtils equalsIgnoreCase
public static boolean equalsIgnoreCase(String str1, String str2)
Compares two Strings, returning true
if they are equal ignoring the case.
From source file:com.ms.commons.file.image.GravityEnum.java
public static GravityEnum getByValue(String gravity) { if (StringUtils.isBlank(gravity)) { return null; }//w w w. j a v a 2 s . c o m for (GravityEnum g : GravityEnum.values()) { if (StringUtils.equalsIgnoreCase(g.getValue(), gravity)) { return g; } } return null; }
From source file:com.tesora.dve.siteprovider.DynamicSiteStatus.java
public static DynamicSiteStatus fromString(String s) { if (s == null || "".equals(s)) throw new IllegalArgumentException("Value cannot be null or empty!"); for (DynamicSiteStatus sis : values()) { if (StringUtils.equalsIgnoreCase(sis.name(), s)) { return sis; }// w w w. ja v a 2s . co m } throw new IllegalArgumentException("'" + s + "' is not a valid staus value"); }
From source file:com.thistech.spotlink.util.PlacementRequestUtil.java
public static String getTargetCodeValue(PlacementRequestType placementRequest, String key) { if (placementRequest != null && placementRequest.getClient() != null && placementRequest.getClient().getTargetCode() != null) { for (TargetCode targetCode : placementRequest.getClient().getTargetCode()) { if (StringUtils.equalsIgnoreCase(targetCode.getKey(), key)) { if (!CollectionUtils.isEmpty(targetCode.getContent())) { return (String) targetCode.getContent().iterator().next(); }/*from w ww. j a va2 s . c o m*/ } } } return null; }
From source file:com.mmj.app.biz.cons.TopicOrderEnum.java
/** * ?name?// ww w . j av a 2 s . c o m */ public static TopicOrderEnum getEnum(String name) { if (StringUtils.isEmpty(name)) { return null; } for (TopicOrderEnum current : values()) { if (StringUtils.equalsIgnoreCase(current.name, name)) { return current; } } return null; }
From source file:com.sfs.whichdoctor.formatter.AgedDebtorsAnalysisFormatter.java
/** * Gets the field./*from w w w . jav a 2 s .c o m*/ * * @param grouping the grouping * @param field the field * @param format the format * @return the field */ public static String getField(final AgedDebtorsGrouping grouping, final String field, final String format) { String value = ""; if (grouping == null || field == null) { return value; } if (StringUtils.equalsIgnoreCase(field, "Grouping")) { value = grouping.getName(); if (StringUtils.isBlank(value)) { value = "Uncategorised"; } } if (StringUtils.equalsIgnoreCase(field, "Total")) { value = Formatter.toCurrency(grouping.getTotal(), "$"); if (StringUtils.equalsIgnoreCase(format, "html")) { value = "<div style=\"text-align: right\">" + value + "</div>"; } } if (value == null) { value = ""; } return value; }
From source file:com.mmj.app.biz.cons.TopicOrderTimeEnum.java
/** * ?name?//www . j a v a 2 s . c o m */ public static TopicOrderTimeEnum getEnum(String name) { if (StringUtils.isEmpty(name)) { return null; } for (TopicOrderTimeEnum current : values()) { if (StringUtils.equalsIgnoreCase(current.name, name)) { return current; } } return null; }
From source file:com.ms.app.web.commons.tools.StaticsTools.java
public static void setDebugModeIfEixisted(HttpServletRequest request) { String isDebug = request.getParameter("_is_debug_"); if (StringUtils.equalsIgnoreCase(isDebug, "true")) { isDebugMode.set(true);//from w w w . j a v a 2s. co m } else { isDebugMode.set(false); } }
From source file:com.inkubator.hrm.web.search.AppraisalProgramSearchParameter.java
public String getName() { if (StringUtils.equalsIgnoreCase(getKeyParam(), "name")) { name = getParameter();/*from ww w. j av a 2s .com*/ } else { name = null; } return name; }
From source file:com.tesora.dve.common.SiteInstanceStatus.java
public static boolean isValidUserOption(String option) { for (SiteInstanceStatus s : values()) { if ((s != FAILED) && StringUtils.equalsIgnoreCase(s.name(), option)) { return true; }/*from ww w.j a va 2 s.com*/ } return false; }
From source file:com.mmj.app.biz.cons.TabTypeEnum.java
/** * ?name?/*from ww w.j a v a 2 s . c o m*/ */ public static TabTypeEnum getEnum(String name) { if (StringUtils.isEmpty(name)) { return null; } for (TabTypeEnum current : values()) { if (StringUtils.equalsIgnoreCase(current.name, name)) { return current; } } return null; }