本文整理汇总了Java中org.apache.commons.lang3.StringUtils.equalsIgnoreCase方法的典型用法代码示例。如果您正苦于以下问题:Java StringUtils.equalsIgnoreCase方法的具体用法?Java StringUtils.equalsIgnoreCase怎么用?Java StringUtils.equalsIgnoreCase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.lang3.StringUtils
的用法示例。
在下文中一共展示了StringUtils.equalsIgnoreCase方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildSAMLLogoutRequestAndStoreInSession
import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
protected void buildSAMLLogoutRequestAndStoreInSession(
HttpServletRequest request, String samlResponse)
throws SaaSApplicationException {
String samlSessionId = getSamlResponseExtractor()
.getSessionIndex(samlResponse);
String nameID = getSamlResponseExtractor().getUserId(samlResponse);
String tenantID = getSamlResponseExtractor().getTenantID(samlResponse);
String issuer = getSamlResponseExtractor().getIssuer(samlResponse);
authSettings.init(tenantID);
if(!StringUtils.equalsIgnoreCase(issuer, authSettings.getIdpIssuer())) {
//TODO: move issuer verification to AssertionContentVerifier if possible.
throw new IssuerNotMatchException();
}
final SigningAlgorithmType signingAlgorithm = getSigningAlgorithmType();
String logoutRequest = logoutRequestGenerator.generateLogoutRequest(
samlSessionId, nameID, getLogoutURL(),
getKeystorePath(), getIssuer(),
getKeyAlias(), getKeystorePass(), signingAlgorithm);
request.getSession().setAttribute(SESSION_PARAM_SAML_LOGOUT_REQUEST, logoutRequest);
}
示例2: validate
import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
@Override
public void validate(Object target, Errors errors) {
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "employeeFirstName", "NotEmpty.registration.fname");
Employee employeeRegistration = (Employee) target;
if (StringUtils.isNotBlank(employeeRegistration.getEmpPassword())) {
if (passwordValidator.validate(employeeRegistration.getEmpPassword())) {
//Check if the confirmation password is same as the new password.
if (!StringUtils.equalsIgnoreCase(employeeRegistration.getEmpPassword(), employeeRegistration.getEmpPassword2())) {
errors.rejectValue("empPassword2", "NotValid.registration.confirm.password");
}
} else {
errors.rejectValue("empPassword", "NotValid.registration.password");
}
}
}
示例3: desEncrypt
import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
public static String desEncrypt(String origin, String encoding) {
if ((origin == null) || (encoding == null)) {
return null;
}
// TODO String.valueOf(null) == "null";
if (StringUtils.equalsIgnoreCase("null", origin)) {
return null;
}
try {
return encrypt(origin.getBytes(encoding), "DES");
} catch (UnsupportedEncodingException e) {
System.out.println("The encoding is not supported.");
}
return null;
}
示例4: getHVR
import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
public static BigDecimal getHVR(RiskClass r, Sensitivity s) {
if (r.equals(RiskClass.COMMODITY)) {
return cm.getHVR();
} else if (r.equals(RiskClass.CREDIT_NON_QUALIFYING)) {
return cnq.getHVR();
} else if (r.equals(RiskClass.CREDIT_QUALIFYING) && StringUtils.equalsIgnoreCase(s.getRiskType(), RiskType.RISK_TYPE_BASE_CORR)) {
throw new RuntimeException("called HVR for base corr sensitvity: " + s);
} else if (r.equals(RiskClass.CREDIT_QUALIFYING)) {
return cq.getHVR();
} else if (r.equals(RiskClass.EQUITY)) {
return eq.getHVR();
} else if (r.equals(RiskClass.FX)) {
return fx.getHVR();
} else if (r.equals(RiskClass.INTEREST_RATE)) {
return ir.getHVR();
} else {
throw new RuntimeException("found bad com.acadiasoft.simm.model.risk class: " + r);
}
}
示例5: getResponseFileName
import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
/**
* 从响应消息的Content-Disposition头中获得文件名。
*
* @param headers
* @return 如果不是文件则返回null
*/
private static String getResponseFileName(Header[] headers) {
String filename = null;
if (headers == null) {
return null;
}
for (Header header : headers) {
if (StringUtils.equalsIgnoreCase(header.getName(), "Content-Disposition")) {
String value = header.getValue();
String key = "filename=";
int keyLength = key.length();
int position = StringUtils.indexOfIgnoreCase(header.getValue(), key);
if (position > -1) {
filename = StringUtils.substring(value, position + keyLength);
}
break;
}
}
return filename;
}
示例6: getSensitivityCorrelation
import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
public static BigDecimal getSensitivityCorrelation(RiskClass r, Sensitivity si, Sensitivity sk) {
if (r.equals(RiskClass.COMMODITY)) {
return cm.getSensitivityCorrelation(si, sk);
} else if (r.equals(RiskClass.CREDIT_NON_QUALIFYING)) {
return cnq.getSensitivityCorrelation(si, sk);
} else if (r.equals(RiskClass.CREDIT_QUALIFYING)
&& StringUtils.equalsIgnoreCase(si.getRiskType(), RiskType.RISK_TYPE_BASE_CORR)
&& StringUtils.equalsIgnoreCase(sk.getRiskType(), RiskType.RISK_TYPE_BASE_CORR)) {
throw new RuntimeException("called com.acadiasoft.simm.model.risk correlation for base corr sensitvity: " + si + ", " + sk);
} else if (r.equals(RiskClass.CREDIT_QUALIFYING)) {
return cq.getSensitivityCorrelation(si, sk);
} else if (r.equals(RiskClass.EQUITY)) {
return eq.getSensitivityCorrelation(si, sk);
} else if (r.equals(RiskClass.FX)) {
return fx.getSensitivityCorrelation(si, sk);
} else if (r.equals(RiskClass.INTEREST_RATE)) {
return ir.getSensitivityCorrelation(si, sk);
} else {
throw new RuntimeException("found bad com.acadiasoft.simm.model.risk class: " + r);
}
}
示例7: covertRequest
import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
public static Seed covertRequest(Request request) {
if (StringUtils.isNotEmpty(request.getMethod()) && !StringUtils.equalsIgnoreCase(request.getMethod(), "get")) {
log.warn("vscrawler can not support webmagic get method,this request {} will be ignore", request.getUrl());
return null;
}
Seed seed = new Seed(request.getUrl());
seed.setExt(Maps.transformEntries(request.getExtras(), new Maps.EntryTransformer<String, Object, String>() {
@Override
public String transformEntry(String key, Object value) {
if (value instanceof String) {
return (String) value;
}
return JSONObject.toJSONString(value);
}
}));
return seed;
}
示例8: process
import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
@Override
public void process(PageContext pageContext) {
MediaType mediaType = pageContext.getMediaType();
String subtype = mediaType.subtype();
if (!supportMedia.contains(subtype)) {
return;
}
byte[] body = pageContext.getBody();
String url = pageContext.getRequest().url().toString();
String name = DigestUtils.md5Hex(url);
String path = Take.path;
File file = new File(path);
file.mkdirs();
try {
if (StringUtils.equalsIgnoreCase(subtype, "html")) {
LOGGER.info("保存html文件 {} {}", url, name);
Files.write(pageContext.getHtml(), new File(path, name + ".html"), Charset.forName(pageContext.getCharset()));
} else if (StringUtils.equalsIgnoreCase(subtype, "jpeg")
|| StringUtils.equalsIgnoreCase(subtype, "png")
|| StringUtils.equalsIgnoreCase(subtype, "gif")
) {
LOGGER.info("保存图片 {} {}", url, name);
Files.write(body, new File(path, name + "." + subtype));
}
} catch (IOException e) {
e.printStackTrace();
}
}
示例9: getSensitivityCorrelation
import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
@Override
public BigDecimal getSensitivityCorrelation(Sensitivity si, Sensitivity sk) {
if (StringUtils.equalsIgnoreCase(Sensitivity.RESIDUAL, si.getBucket()) || StringUtils.equalsIgnoreCase(Sensitivity.RESIDUAL, sk.getBucket())) {
return RESIDUAL;
} else {
// NOTE: both sensitivities should be in the same bucket, so bi and bk should
// be equal
int i = Integer.valueOf(si.getBucket());
int k = Integer.valueOf(sk.getBucket());
return CORRELATIONS[i - 1][k - 1];
}
}
示例10: getTemplateDedicatedFiles
import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
private List<String> getTemplateDedicatedFiles(String templateName, List<String> jsonDataFiles, List<String> templateNames) {
final List<String> templateDedicatedDataFiles = Lists.newArrayList();
for (String jsonDataFile : jsonDataFiles) {
final String[] jsonDataIds = StringUtils.substringsBetween(jsonDataFile, PatternLabConstants.SELECTOR, PatternLabConstants.SELECTOR);
if (jsonDataIds == null || jsonDataIds.length == 0) {
templateDedicatedDataFiles.add(jsonDataFile);
} else {
final String jsonDataId = jsonDataIds[0];
if (StringUtils.equalsIgnoreCase(templateName, jsonDataId) || !templateNames.contains(jsonDataId)) {
templateDedicatedDataFiles.add(jsonDataFile);
}
}
}
return templateDedicatedDataFiles;
}
示例11: getBucketCorrelation
import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
@Override
public BigDecimal getBucketCorrelation(String bi, String bk) {
if (StringUtils.equalsIgnoreCase(Sensitivity.RESIDUAL, bi) || StringUtils.equalsIgnoreCase(Sensitivity.RESIDUAL, bk)) {
throw new RuntimeException("called bucket correlation for a residual bucket: " + bi + ", " + bk);
} else {
return NON_RESIDUAL_TO_NON_RESIDUAL;
}
}
示例12: parseLogoutType
import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
/**
* Parse raw logout type string to {@link LogoutType}.
*
* @param logoutType the reg svc
*/
private static LogoutType parseLogoutType(final String logoutType) {
if (StringUtils.equalsIgnoreCase(logoutType, RegisteredServiceLogoutTypeEditBean.BACK.toString())) {
return LogoutType.BACK_CHANNEL;
}
if (StringUtils.equalsIgnoreCase(logoutType, RegisteredServiceLogoutTypeEditBean.FRONT.toString())) {
return LogoutType.FRONT_CHANNEL;
}
return LogoutType.NONE;
}
示例13: forTextAndMensa
import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
@Override
public Optional<DateSearchResult> forTextAndMensa(String text, Mensa mensa) {
Optional<DateSearchResult> result = Optional.empty();
if (StringUtils.equalsIgnoreCase(text, messagesService.getMessage(Messages.COMMAND_DATE_TODAY))) {
LocalDate today = supplier.get();
if (timeUtils.isOpeningDay(today, mensa)) {
result = Optional.of(DateSearchResult.of(today, Optional.empty()));
} else {
result = Optional.of(DateSearchResult.of(today, Optional.of(timeUtils.nextOpeningDay(today, mensa))));
}
}
return result;
}
示例14: getBaseCorrSensitvityCorrelation
import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
public static BigDecimal getBaseCorrSensitvityCorrelation(RiskClass r, Sensitivity si, Sensitivity sk) {
if (r.equals(RiskClass.CREDIT_QUALIFYING)
&& StringUtils.equalsIgnoreCase(si.getRiskType(), RiskType.RISK_TYPE_BASE_CORR)
&& StringUtils.equalsIgnoreCase(sk.getRiskType(), RiskType.RISK_TYPE_BASE_CORR)) {
return bc.getRiskCorrelation(si, sk);
} else {
throw new RuntimeException("called base corr correlation with other com.acadiasoft.simm.model.sensitivity type: " + si + ", " + sk);
}
}
示例15: getSensitivityCorrelation
import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
@Override
public BigDecimal getSensitivityCorrelation(Sensitivity si, Sensitivity sk) {
if (StringUtils.equalsIgnoreCase(Sensitivity.RESIDUAL, si.getBucket()) || StringUtils.equalsIgnoreCase(Sensitivity.RESIDUAL, sk.getBucket())) {
return RESIDUAL;
} else if (StringUtils.equals(si.getQualifier(), sk.getQualifier())) {
return AGGREGATE_SAME;
} else {
return AGGREGATE_DIFF;
}
}