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:com.inkubator.hrm.web.payroll.PayTempOvertimeFormController.java
public void handingFileUpload(FileUploadEvent fileUploadEvent) { Map<String, String> results = uploadFilesUtil.checkUploadFileSizeLimit(fileUploadEvent.getFile()); if (StringUtils.equals(results.get("result"), "true")) { file = fileUploadEvent.getFile(); fileName = file.getFileName();//from w ww .j a va2 s.c o m } else { ResourceBundle messages = ResourceBundle.getBundle("Messages", new Locale(FacesUtil.getSessionAttribute(HRMConstant.BAHASA_ACTIVE).toString())); String errorMsg = messages.getString("global.file_size_should_not_bigger_than") + " " + results.get("sizeMax"); MessagesResourceUtil.setMessagesFromException(FacesMessage.SEVERITY_ERROR, "global.error", errorMsg, FacesUtil.getSessionAttribute(HRMConstant.BAHASA_ACTIVE).toString()); } }
From source file:de.micromata.genome.gwiki.auth.GWikiSimpleUser.java
public boolean isAnon() { return StringUtils.equals(user, ANON_USER_NAME); }
From source file:de.micromata.tpsb.doc.parser.ParserResult.java
public FileInfo getFileInfoForClassName(final String className) { return CollectionUtils.find(this, new Predicate<FileInfo>() { @Override/* w w w.j a v a 2 s. c o m*/ public boolean evaluate(FileInfo fInfo) { return StringUtils.equals(className, fInfo.getClassName()) || StringUtils.endsWith(fInfo.getClassName(), className); } }); }
From source file:com.bitium.confluence.saml.IdpKeyManager.java
@Override public Credential getCredential(String key) { return StringUtils.equals(key, entityId) ? credential : null; }
From source file:com.cognifide.qa.bb.aem.touch.data.componentconfigs.ComponentConfiguration.java
/** * * @param tabName Tab name in the dialog window * @param configurationKey onfigurationKey key of yaml configuration * @param type field type provided in yaml component configuration * @return// w w w . j ava 2 s . com */ public List<FieldConfig> getFieldConfigsByType(String tabName, String configurationKey, String type) { return getConfigurationForTab(tabName).stream().filter(t -> StringUtils.equals(t.getType(), type)) .collect(Collectors.toList()); }
From source file:de.micromata.mgc.javafx.launcher.gui.generic.LoggingConfigTabController.java
public boolean isFallback() { return StringUtils.equals(getId(), "fallbacklogtab"); }
From source file:de.blizzy.documentr.DocumentrMatchers.java
public static PageForm argPageForm(final String projectName, final String branchName, final String path, final String parentPagePath, final String title, final String text, final String commit) { Matcher<PageForm> matcher = new ArgumentMatcher<PageForm>() { @Override/* w w w. j a v a2s .c o m*/ public boolean matches(Object argument) { PageForm form = (PageForm) argument; return StringUtils.equals(form.getProjectName(), projectName) && StringUtils.equals(form.getBranchName(), branchName) && StringUtils.equals(form.getPath(), path) && StringUtils.equals(form.getParentPagePath(), parentPagePath) && StringUtils.equals(form.getTitle(), title) && StringUtils.equals(form.getText(), text) && StringUtils.equals(form.getCommit(), commit); } }; return argThat(matcher); }
From source file:com.glaf.core.tree.component.TreeComponent.java
/** * This method compares all attributes, except for parent and children * /*from w ww . j av a 2 s . c om*/ * @param o * the object to compare to */ public boolean equals(Object o) { if (!(o instanceof TreeComponent)) { return false; } TreeComponent m = (TreeComponent) o; // Compare using StringUtils to avoid NullPointerExceptions return StringUtils.equals(m.getAction(), this.action) && StringUtils.equals(m.getAlign(), this.align) && StringUtils.equals(m.getAltImage(), this.altImage) && StringUtils.equals(m.getDescription(), this.description) && StringUtils.equals(m.getForward(), this.forward) && StringUtils.equals(m.getHeight(), this.height) && StringUtils.equals(m.getImage(), this.image) && StringUtils.equals(m.getLocation(), this.location) && StringUtils.equals(m.getId(), this.id) && StringUtils.equals(m.getOnclick(), this.onclick) && StringUtils.equals(m.getOndblclick(), this.ondblclick) && StringUtils.equals(m.getOnmouseout(), this.onmouseout) && StringUtils.equals(m.getOnmouseover(), this.onmouseover) && StringUtils.equals(m.getOnContextTree(), this.onContextTree) && StringUtils.equals(m.getPage(), this.page) && StringUtils.equals(m.getRoles(), this.roles) && StringUtils.equals(m.getTarget(), this.target) && StringUtils.equals(m.getTitle(), this.title) && StringUtils.equals(m.getToolTip(), this.toolTip) && StringUtils.equals(m.getWidth(), this.width) && StringUtils.equals(m.getModule(), this.module); }
From source file:com.inkubator.hrm.web.personalia.LoanApprovalFormController.java
@PostConstruct @Override//from w w w. j a va 2s. c o m public void initialization() { try { super.initialization(); String id = FacesUtil.getRequestParameter("execution"); selectedApprovalActivity = approvalActivityService.getEntiyByPK(Long.parseLong(id.substring(1))); isWaitingApproval = selectedApprovalActivity .getApprovalStatus() == HRMConstant.APPROVAL_STATUS_WAITING_APPROVAL; isApprover = StringUtils.equals(UserInfoUtil.getUserName(), selectedApprovalActivity.getApprovedBy()); isRequester = StringUtils.equals(UserInfoUtil.getUserName(), selectedApprovalActivity.getRequestBy()); Gson gson = JsonUtil.getHibernateEntityGsonBuilder().create(); selectedLoan = gson.fromJson(selectedApprovalActivity.getPendingData(), Loan.class); EmpData empData = empDataService.getByIdWithDetail(selectedLoan.getEmpData().getId()); selectedLoan.setEmpData(empData); loanPaymentDetails = loanService.getAllDataLoanPaymentDetails(selectedLoan.getInterestRate(), selectedLoan.getTermin(), selectedLoan.getLoanPaymentDate(), selectedLoan.getNominalPrincipal(), selectedLoan.getTypeOfInterest()); } catch (Exception ex) { LOGGER.error("Error", ex); } }
From source file:com.thoughtworks.go.server.service.BuildRepositoryService.java
private void checkAgentUUID(JobIdentifier jobIdentifier, String agentUuid, String state) { JobInstance job = jobInstanceService.buildByIdWithTransitions(jobIdentifier.getBuildId()); if (!StringUtils.equals(job.getAgentUuid(), agentUuid)) { LOGGER.error("Build Instance [{}] is using agent [{}] but is being updated to [{}] from agent [{}]", jobIdentifier.toString(), job.getAgentUuid(), state, agentUuid); throw new InvalidAgentException("AgentUUID has changed in the middle of a job. AgentUUID:" + agentUuid + ", Build: " + job.toString()); }/* www .j av a2 s . co m*/ }