List of usage examples for org.apache.commons.lang3 StringUtils equalsIgnoreCase
public static boolean equalsIgnoreCase(final CharSequence str1, final CharSequence str2)
Compares two CharSequences, returning true if they represent equal sequences of characters, ignoring case.
null s are handled without exceptions.
From source file:com.yqboots.initializer.core.builder.excel.SystemPropertiesSheetBuilder.java
@Override protected void formatChecking(final Sheet sheet) { // get the title row final Row row = sheet.getRow(0); final Cell keyCell = row.getCell(0); Assert.isTrue(StringUtils.equalsIgnoreCase(keyCell.getStringCellValue(), "Name"), "Column 'Name' is required"); final Cell valueCell = row.getCell(1); Assert.isTrue(StringUtils.equalsIgnoreCase(valueCell.getStringCellValue(), "Profile"), "Column 'Profile' is required"); }
From source file:edu.umn.se.trap.form.Location.java
@Override public boolean equals(Object location) { if (location instanceof Location) { return StringUtils.equalsIgnoreCase(this.city, ((Location) location).getCity()) && StringUtils.equalsIgnoreCase(this.country, ((Location) location).getCountry()) && StringUtils.equalsIgnoreCase(this.state, ((Location) location).getState()); }/*from w w w . j av a 2s .co m*/ return false; }
From source file:$.RoleAction.java
@Action(name = "/{name}/edit", method = HttpMethod.GET) public ActionResult roleForm(@ActionParam("name") String name) { ActionResult actionResult = new ActionResult("freemarker", "/view/admin/role/role-form.ftl"); if (!StringUtils.equalsIgnoreCase(name, "-")) { Role role = roleManager.getRoleByName(name); actionResult.addToModel("role", role); } else {// ww w . j a v a 2s .com actionResult.addToModel("role", new DefaultRole()); } return actionResult; }
From source file:com.inkubator.hrm.web.search.JabatanSearchParameter.java
public String getUnitKerjaName() { if (StringUtils.equalsIgnoreCase(getKeyParam(), "unitKerjaName")) { unitKerjaName = getParameter();/*from www. ja va 2s .co m*/ } else { unitKerjaName = null; } return unitKerjaName; }
From source file:edu.umn.se.trap.rule.grantrule.NihOnlyPublicTransitOrAirfareRule.java
/** * @param expense/* ww w . java 2 s . c o m*/ * @throws TrapException */ private void checkNihTransportation(Expense expense) throws TrapException { /* * Check to make sure the expense is a transportation expense, excluding * public transportation and air expenses. */ if (expense.getType().equals(ExpenseType.TRANSPORTATION) && !(StringUtils .equalsIgnoreCase(((TransportationExpense) expense).getTranportationType(), "PUBLIC_TRANSPORTATION") || StringUtils.equalsIgnoreCase(((TransportationExpense) expense).getTranportationType(), "AIR") || StringUtils.equalsIgnoreCase(((TransportationExpense) expense).getTranportationType(), "LUGGAGE") || StringUtils.equalsIgnoreCase(((TransportationExpense) expense).getTranportationType(), "BAGGAGE"))) { GrantSet grantSet = expense.getEligibleGrants(); if (grantSet == null) { throw new TrapException("Invalid TrapForm object: grantSet was null."); } Set<FormGrant> grants = grantSet.getGrants(); if (grants == null) { throw new TrapException("Invalid TrapForm object: grants was null."); } Iterator<FormGrant> grantIter = grants.iterator(); while (grantIter.hasNext()) { FormGrant grant = grantIter.next(); if (StringUtils.equalsIgnoreCase(grant.getFundingOrganization(), "NIH")) { // Remove the grant if it is a NIH grant. grantSet.removeGrant(grant.getAccountName()); } } } }
From source file:com.github.lburgazzoli.examples.karaf.hz.data.cmd.HzDataCommand.java
@Override public void execute() throws Exception { if (StringUtils.equalsIgnoreCase(TYPE_MAP, type)) { if (StringUtils.equalsIgnoreCase(CMD_PUT, action)) { doExecuteMapPut(getService().getInstance()); } else if (StringUtils.equalsIgnoreCase(CMD_GET, action)) { doExecuteMapGet(getService().getInstance()); } else if (StringUtils.equalsIgnoreCase(CMD_QUERY, action)) { doExecuteMapQuery(getService().getInstance()); }/*from w w w .j av a 2 s. c om*/ } else if (StringUtils.equalsIgnoreCase(TYPE_EVT, type)) { if (StringUtils.equalsIgnoreCase(CMD_SEND, action)) { doExecuteEvtSend(getService().getInstance()); } } }
From source file:edu.umn.se.trap.rule.grantrule.DodGrantHertzRule.java
/** * @param expense/* ww w.ja v a 2 s. co m*/ * @throws TrapException */ private void checkDodHertz(Expense expense) throws TrapException { /* * Expense Type: TRANSPORTATION isRental: true Transportation Type: CAR * Carrier: Hertz */ if (expense.getType().equals(ExpenseType.TRANSPORTATION) && ((TransportationExpense) expense).isRental() && StringUtils.equalsIgnoreCase(((TransportationExpense) expense).getTranportationType(), "CAR")) { GrantSet grantSet = expense.getEligibleGrants(); if (grantSet == null) { throw new TrapException("Invalid TrapForm object: grantSet was null."); } Set<FormGrant> grants = grantSet.getGrants(); if (grants == null) { throw new TrapException("Invalid TrapForm object: grants was null."); } Iterator<FormGrant> grantIter = grants.iterator(); while (grantIter.hasNext()) { FormGrant grant = grantIter.next(); if (StringUtils.equalsIgnoreCase(grant.getFundingOrganization(), "DOD")) { if (!StringUtils.equalsIgnoreCase(((TransportationExpense) expense).getCarrier(), "Hertz")) { // If it's not Hertz being charged to DOD, remove it. grantSet.removeGrant(grant.getAccountName()); } } } } }
From source file:com.norconex.commons.lang.EqualsUtil.java
/** * Whether a source string equals ALL of the target string. * @param source string being tested for equality with target strings * @param targets one or more strings to be tested with source string * for equality/* w w w . j a va2 s. c o m*/ * @return <code>true</code> if all of the target strings are equal */ public static boolean equalsAllIgnoreCase(String source, String... targets) { if (targets == null) { return source == null; } for (String target : targets) { if (!StringUtils.equalsIgnoreCase(source, target)) { return false; } } return true; }
From source file:com.inkubator.hrm.web.search.ApprovalDefinitionSearchParameter.java
public String getOnBehaltAppriverIndividual() { if (StringUtils.equalsIgnoreCase(getKeyParam(), "onBehaltAppriverIndividual")) { onBehaltAppriverIndividual = getParameter(); } else {//w ww . j av a 2 s. c o m onBehaltAppriverIndividual = null; } return onBehaltAppriverIndividual; }
From source file:com.yqboots.initializer.core.builder.excel.DataDictSheetBuilder.java
@Override protected void formatChecking(final Sheet sheet) { // get the title row final Row row = sheet.getRow(0); final Cell nameCell = row.getCell(0); final Cell textCell = row.getCell(1); final Cell valueCell = row.getCell(2); Assert.isTrue(StringUtils.equalsIgnoreCase(nameCell.getStringCellValue(), "name"), "Column 'name' is required"); Assert.isTrue(StringUtils.equalsIgnoreCase(textCell.getStringCellValue(), "text"), "Column 'text' is required"); Assert.isTrue(StringUtils.equalsIgnoreCase(valueCell.getStringCellValue(), "value"), "Column 'value' is required"); }