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.widowcrawler.terminator.parse.Parser.java
private boolean matchStringStart(String toMatch) { // be permissive with casing return StringUtils.equalsIgnoreCase(data.substring(dataPtr, dataPtr + toMatch.length()), toMatch); }
From source file:com.ottogroup.bi.spqr.node.resource.pipeline.MicroPipelineResource.java
/** * Lists all {@link MicroPipeline} instances registered with this node. Depending on the <i>mode</i> parameter, the * result contains either just a list of pipeline identifiers or contains the associated {@link MicroPipelineConfiguration} as well. * @param mode result mode: SIMPLE, FULL (default: SIMPLE) * @return//from www . ja v a2s . c o m */ @Produces(value = "application/json") @Timed(name = "pipeline-list") @GET @Path("list") public ListRegisteredMicroPipelinesResponse listRegisteredPipelines(@QueryParam("mode") final String mode) { if (StringUtils.isBlank(mode) || StringUtils.equalsIgnoreCase(mode, LIST_PIPELINES_MODE_SIMPLE)) { return new ListRegisteredMicroPipelinesResponse(this.microPipelineManager.getProcessingNodeId(), this.microPipelineManager.getPipelineIds()); } return new ListRegisteredMicroPipelinesResponse(this.microPipelineManager.getProcessingNodeId(), this.microPipelineManager.getPipelineIds(), this.microPipelineManager.getPipelineConfigurations()); }
From source file:com.inkubator.hrm.web.approval.ApprovalDefinitionFormController.java
public void onBehalfAppoverChange() { String apporverType = approvalDefinitionModel.getOnBehalfType(); if (StringUtils.equalsIgnoreCase(apporverType, HRMConstant.APPROVAL_TYPE_INDIVIDUAL)) { onBehalfApproverTypeIndividual = Boolean.FALSE; onBehalfApproverTypePosition = Boolean.TRUE; // onBehalfApproverTypeDepartment = Boolean.TRUE; }//from w w w . j a v a 2s . c o m if (StringUtils.equalsIgnoreCase(apporverType, HRMConstant.APPROVAL_TYPE_DEPARTMENT)) { onBehalfApproverTypeIndividual = Boolean.TRUE; onBehalfApproverTypePosition = Boolean.TRUE; // onBehalfApproverTypeDepartment = Boolean.FALSE; } if (StringUtils.equalsIgnoreCase(apporverType, HRMConstant.APPROVAL_TYPE_POSITION)) { onBehalfApproverTypeIndividual = Boolean.TRUE; onBehalfApproverTypePosition = Boolean.FALSE; // onBehalfApproverTypeDepartment = Boolean.TRUE; } approvalDefinitionModel.setHrmUserByOnBehalfIndividualId(null); approvalDefinitionModel.setHrmUserByOnBehalfIndividualName(""); approvalDefinitionModel.setJabatanByOnBehalfPositionId(null); approvalDefinitionModel.setJabatanByOnBehalfPositionName(""); }
From source file:com.mirth.connect.client.core.Client.java
public Client(String address, int timeout, String[] httpsProtocols, String[] httpsCipherSuites, String[] apiProviderClasses) throws URISyntaxException { if (!address.endsWith("/")) { address += "/"; }//from w ww. j ava2s . c o m URI addressURI = new URI(address); serverConnection = new ServerConnection(timeout, httpsProtocols, httpsCipherSuites, StringUtils.equalsIgnoreCase(addressURI.getScheme(), "http")); ClientConfig config = new ClientConfig().connectorProvider(new ConnectorProvider() { @Override public Connector getConnector(javax.ws.rs.client.Client client, Configuration runtimeConfig) { return serverConnection; } }); // Register providers for (Class<?> providerClass : new Reflections("com.mirth.connect.client.core.api.providers") .getTypesAnnotatedWith(javax.ws.rs.ext.Provider.class)) { config.register(providerClass); } config.register(MultiPartFeature.class); // Register servlet interfaces Set<Class<? extends BaseServletInterface>> servletClasses = new Reflections( "com.mirth.connect.client.core.api.servlets").getSubTypesOf(BaseServletInterface.class); for (Class<?> servletClass : servletClasses) { config.register(servletClass); } if (ArrayUtils.isNotEmpty(apiProviderClasses)) { for (String apiProviderClass : apiProviderClasses) { try { config.register(Class.forName(apiProviderClass)); } catch (Throwable t) { logger.error("Error registering API provider class: " + apiProviderClass); } } } client = ClientBuilder.newClient(config); api = addressURI.resolve("api/" + Version.getLatest().toString()); }
From source file:com.softmotions.commons.bean.BeanUtils.java
/** * Checks if the given objects are equal. * * @param a The object to compare with object b. * @param b The object to compare with object a. * @param caseSensitive Tells whether or not to compare string values case sensitive. * This parameter is only respected, in case a is a <code>java.lang.String</code> instance. * @return true if the objects are equal or are both null. *///from ww w. j a v a 2 s .c om public static boolean equals(Object a, Object b, boolean caseSensitive) { if ((a == null) || (b == null)) { return a == b; } if (a instanceof String) { return caseSensitive ? StringUtils.equalsIgnoreCase(a.toString(), b.toString()) : StringUtils.equals(a.toString(), b.toString()); } return a.equals(b); }
From source file:com.inkubator.hrm.web.approval.ApprovalDefinitionPopupFormController.java
public void onProcessChange() { String approvalProcess = approvalDefinitionModel.getProcessType(); if (StringUtils.equalsIgnoreCase(approvalProcess, HRMConstant.ON_APPROVE_INFO) || StringUtils.equalsIgnoreCase(approvalProcess, HRMConstant.ON_REJECT_INFO)) { onProcess = Boolean.TRUE; } else if (StringUtils.equalsIgnoreCase(approvalProcess, HRMConstant.APPROVAL_PROCESS) || approvalProcess == null || approvalProcess.isEmpty()) { onProcess = Boolean.FALSE; }/*from w ww . ja v a 2 s .c om*/ }
From source file:io.wcm.devops.conga.generator.EnvironmentGenerator.java
private void generateFile(RoleFile roleFile, String dir, String fileName, Map<String, Object> config, File nodeDir, Template template, String roleName, String roleVariantName, String templateName) { File file = new File(nodeDir, dir != null ? FilenameUtils.concat(dir, fileName) : fileName); boolean duplicateFile = generatedFilePaths.contains(FileUtil.getCanonicalPath(file)); if (file.exists()) { file.delete();/* ww w.j a v a 2 s . co m*/ } // skip file if condition does not evaluate to a non-empty string or is "false" if (StringUtils.isNotEmpty(roleFile.getCondition())) { String condition = VariableStringResolver.resolve(roleFile.getCondition(), config); if (StringUtils.isBlank(condition) || StringUtils.equalsIgnoreCase(condition, "false")) { return; } } FileGenerator fileGenerator = new FileGenerator(environmentName, roleName, roleVariantName, templateName, nodeDir, file, roleFile, config, template, pluginManager, version, dependencyVersions, log); try { fileGenerator.generate(); generatedFilePaths.add(FileUtil.getCanonicalPath(file)); if (duplicateFile) { log.warn("File was generated already, check for file name clashes: " + FileUtil.getCanonicalPath(file)); } } catch (ValidationException ex) { throw new GeneratorException( "File validation failed " + FileUtil.getCanonicalPath(file) + " - " + ex.getMessage()); } catch (Throwable ex) { throw new GeneratorException( "Unable to generate file: " + FileUtil.getCanonicalPath(file) + "\n" + ex.getMessage(), ex); } }
From source file:com.glaf.chart.web.springmvc.ChartController.java
@ResponseBody @RequestMapping("/download") public void download(HttpServletRequest request, HttpServletResponse response) { RequestUtils.setRequestParameterToAttribute(request); Map<String, Object> params = RequestUtils.getParameterMap(request); String chartId = ParamUtils.getString(params, "chartId"); String mapping = ParamUtils.getString(params, "mapping"); String mapping_enc = ParamUtils.getString(params, "mapping_enc"); String name = ParamUtils.getString(params, "name"); String name_enc = ParamUtils.getString(params, "name_enc"); Chart chart = null;//from w w w . jav a2 s . c o m if (StringUtils.isNotEmpty(chartId)) { chart = chartService.getChart(chartId); } else if (StringUtils.isNotEmpty(name)) { chart = chartService.getChartByName(name); } else if (StringUtils.isNotEmpty(name_enc)) { String str = RequestUtils.decodeString(name_enc); chart = chartService.getChartByName(str); } else if (StringUtils.isNotEmpty(mapping)) { chart = chartService.getChartByMapping(mapping); } else if (StringUtils.isNotEmpty(mapping_enc)) { String str = RequestUtils.decodeString(mapping_enc); chart = chartService.getChartByMapping(str); } if (chart != null) { ChartDataManager manager = new ChartDataManager(); chart = manager.getChartAndFetchDataById(chart.getId(), params, RequestUtils.getActorId(request)); logger.debug("chart rows size:" + chart.getColumns().size()); String filename = "chart.png"; String contentType = "image/png"; if (StringUtils.equalsIgnoreCase(chart.getChartType(), "jpeg")) { filename = "chart.jpg"; contentType = "image/jpeg"; } ChartGen chartGen = JFreeChartFactory.getChartGen(chart.getChartType()); if (chartGen != null) { JFreeChart jchart = chartGen.createChart(chart); byte[] bytes = ChartUtils.createChart(chart, jchart); try { ResponseUtils.output(request, response, bytes, filename, contentType); } catch (Exception ex) { ex.printStackTrace(); } } } }
From source file:com.hybris.mobile.data.WebService.java
@Override public String deleteProductInCartAtEntry(String carEntryNumber) throws Exception { try {/*from w ww .j a v a 2 s . co m*/ String response = WebServiceDataProvider.getResponse(mContext, urlForCartEntry() + "/" + carEntryNumber, false, "DELETE", null); ProductStockLevelStatus productStockLevelStatus = JsonUtils.fromJson(response, ProductStockLevelStatus.class); if (productStockLevelStatus != null && StringUtils.equalsIgnoreCase(productStockLevelStatus.getStatusCode(), "success")) { return response; } else { throw new Exception(response); } } catch (Exception e) { LoggingUtils.e(LOG_CAT, e.getLocalizedMessage(), null); throw new Exception(e); } }
From source file:com.glaf.core.service.impl.MxTableDefinitionServiceImpl.java
@Transactional public void saveColumn(String tableName, ColumnDefinition columnDefinition) { tableName = tableName.toUpperCase(); TableDefinition tableDefinition = this.getTableDefinition(tableName); if (tableDefinition != null) { Set<String> cols = new HashSet<String>(); List<ColumnDefinition> columns = tableDefinition.getColumns(); boolean exists = false; if (columns != null && !columns.isEmpty()) { for (ColumnDefinition column : columns) { if (StringUtils.equalsIgnoreCase(column.getColumnName(), columnDefinition.getColumnName())) { column.setValueExpression(columnDefinition.getValueExpression()); column.setFormula(columnDefinition.getFormula()); column.setName(columnDefinition.getName()); column.setTitle(columnDefinition.getTitle()); column.setEnglishTitle(columnDefinition.getEnglishTitle()); column.setHeight(columnDefinition.getHeight()); column.setLength(columnDefinition.getLength()); column.setTranslator(columnDefinition.getTranslator()); column.setPrecision(columnDefinition.getPrecision()); column.setScale(columnDefinition.getScale()); column.setAlign(columnDefinition.getAlign()); column.setCollection(columnDefinition.isCollection()); column.setFrozen(columnDefinition.isFrozen()); column.setNullable(columnDefinition.isNullable()); column.setSortable(columnDefinition.isSortable()); column.setDisplayType(columnDefinition.getDisplayType()); column.setDiscriminator(columnDefinition.getDiscriminator()); column.setFormatter(columnDefinition.getFormatter()); column.setLink(columnDefinition.getLink()); column.setOrdinal(columnDefinition.getOrdinal()); column.setRegex(columnDefinition.getRegex()); column.setSortType(columnDefinition.getSortType()); column.setSummaryExpr(columnDefinition.getSummaryExpr()); column.setSummaryType(columnDefinition.getSummaryType()); columnDefinitionMapper.updateColumnDefinition(column); exists = true;/* w ww .j a v a 2 s . c om*/ break; } } } if (!exists) { String id = (tableName + "_" + columnDefinition.getColumnName()).toUpperCase(); if (!cols.contains(id)) { columnDefinition.setId(id); columnDefinition.setTableName(tableName); columnDefinitionMapper.insertColumnDefinition(columnDefinition); cols.add(id); } } } }