List of usage examples for org.apache.commons.lang3 StringUtils equals
public static boolean equals(final CharSequence cs1, final CharSequence cs2)
Compares two CharSequences, returning true if they represent equal sequences of characters.
null s are handled without exceptions.
From source file:ch.cyberduck.core.DefaultSocketExceptionMappingService.java
@Override public BackgroundException map(final SocketException failure) { final StringBuilder buffer = new StringBuilder(); this.append(buffer, failure.getMessage()); if (StringUtils.equals(failure.getMessage(), "Software caused connection abort")) { return new ConnectionCanceledException(buffer.toString(), failure); }/* w w w . j a v a 2s . c om*/ if (StringUtils.equals(failure.getMessage(), "Socket closed")) { return new ConnectionCanceledException(buffer.toString(), failure); } return new ConnectionRefusedException(buffer.toString(), failure); }
From source file:com.inkubator.hrm.web.reference.BankDetailController.java
@PostConstruct @Override//www.j a v a 2 s .c o m public void initialization() { try { super.initialization(); String execution = FacesUtil.getRequestParameter("execution"); String param = execution.substring(0, 1); if (StringUtils.equals(param, "e")) { selectedBank = bankService.getEntityWithDetail(Long.parseLong(execution.substring(1))); } } catch (Exception ex) { LOGGER.error("error", ex); } }
From source file:com.thoughtworks.go.config.validation.ArtifactDirValidator.java
public void validate(CruiseConfig cruiseConfig) throws Exception { ServerConfig serverConfig = cruiseConfig.server(); String artifactDir = serverConfig.artifactsDir(); if (isEmpty(artifactDir)) { throw new Exception("Please provide a not empty value for artifactsdir"); }//from www.ja va2s . com if (StringUtils.equals(".", artifactDir) || new File("").getAbsolutePath().equals(new File(artifactDir).getAbsolutePath())) { throw new Exception("artifactsdir should not point to the root of sand box [" + new File(artifactDir).getAbsolutePath() + "]"); } }
From source file:com.thoughtworks.go.config.DependsConfig.java
public boolean depends(String pipelineName, String stageName) { return StringUtils.equals(this.pipeline, pipelineName) && StringUtils.equals(this.stage, stageName); }
From source file:com.cognifide.qa.bb.aem.touch.siteadmin.aem61.TemplateList.java
void selectTemplate(String templateName) { WebElement template = templates.stream().filter( t -> StringUtils.equals(t.findElement(By.cssSelector("div.label > h4")).getText(), templateName)) .findFirst().orElseThrow(() -> new IllegalArgumentException("Template not found: " + templateName)); template.click();//from w w w .j av a 2 s . com }
From source file:de.micromata.genome.gwiki.plugin.vfolder_1_0.GWikiVFileActionBean.java
@Override public Object onInit() { init();// w w w . j ava2 s. co m if (folderNode.isDirectAttachments() == true || StringUtils.equals(wikiContext.getRequestParameter("dl"), "true") == true) { return doDownload(); } if (embedded == true) { if (folderNode.isHtmlVFile(pageId) == false) { try { GWikiVFolderUtils.writeContent(fvolderEl, pageId, wikiContext.getResponse()); } catch (IOException ex) { GLog.note(GWikiLogCategory.Wiki, "Error writing attachment: " + pageId); } return noForward(); } List<String> csse = folderNode.getAddCss(); if (csse != null) { wikiContext.getRequiredCss().addAll(csse); } rawText = GWikiVFolderUtils.getHtmlBody(fvolderEl, folderNode, pageId); } else { rawText = wikiContext.getWikiWeb().getContentSearcher().getHtmlPreview(wikiContext, pageId); } return null; }
From source file:gob.dp.simco.reporte.service.ReporteSimcoCasoServiceImpl.java
@Override public Integer cantidadMuertosHeridos(String codigoCaso, String estado, String estadoTipo) { if (StringUtils.equals(estado, "01")) { if (StringUtils.equals(estadoTipo, "01")) { return reporteSimcoDao.cantidadMuertosCiviles(codigoCaso); }/* ww w . j a v a 2 s . c o m*/ if (StringUtils.equals(estadoTipo, "02")) { return reporteSimcoDao.cantidadMuertosPNP(codigoCaso); } if (StringUtils.equals(estadoTipo, "03")) { return reporteSimcoDao.cantidadMuertosFFAA(codigoCaso); } } if (StringUtils.equals(estado, "02")) { if (StringUtils.equals(estadoTipo, "01")) { return reporteSimcoDao.cantidadHeridosCiviles(codigoCaso); } if (StringUtils.equals(estadoTipo, "02")) { return reporteSimcoDao.cantidadHeridosPNP(codigoCaso); } if (StringUtils.equals(estadoTipo, "03")) { return reporteSimcoDao.cantidadHeridosFFAA(codigoCaso); } } return null; }
From source file:com.cognifide.qa.bb.aem.core.siteadmin.internal.TemplateListImpl.java
@Override public void selectTemplate(String templateName) { WebElement template = templates.stream() .filter(t -> StringUtils.equals( t.findElement(By.cssSelector("coral-card-content coral-card-title")).getText(), templateName))/* ww w. j a v a2 s .com*/ .findFirst().orElseThrow(() -> new IllegalArgumentException("Template not found: " + templateName)); template.click(); }
From source file:com.cognifide.qa.bb.email.SubjectSearchTerm.java
@Override public boolean match(Message msg) { return Optional.ofNullable(msg).map(this::getSubjectFromMessage) .map(emailSubject -> StringUtils.equals(emailSubject, subject)).orElse(false); }
From source file:com.anrisoftware.sscontrol.httpd.owncloud.core.DebugLevelRenderer.java
@Override public String toString(Object o, String formatString, Locale locale) { if (StringUtils.equals(formatString, "debug")) { return toString(((Number) o).intValue()); } else {/*w w w .j av a 2 s . c o m*/ return o.toString(); } }