eu.europa.esig.dss.utils.Utils.areStringsEqualIgnoreCase()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(98)

本文整理了Java中eu.europa.esig.dss.utils.Utils.areStringsEqualIgnoreCase()方法的一些代码示例,展示了Utils.areStringsEqualIgnoreCase()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.areStringsEqualIgnoreCase()方法的具体详情如下:
包路径:eu.europa.esig.dss.utils.Utils
类名称:Utils
方法名:areStringsEqualIgnoreCase

Utils.areStringsEqualIgnoreCase介绍

暂无

代码示例

代码示例来源:origin: esig/dss

@Override
boolean isAcceptable(TrustedServiceWrapper service) {
  for (String countryCode : countryCodes) {
    if (Utils.areStringsEqualIgnoreCase(countryCode, service.getCountryCode())) {
      return true;
    }
  }
  return false;
}

代码示例来源:origin: esig/dss

@Test
public void areStringsEqualIgnoreCase() {
  assertTrue(Utils.areStringsEqualIgnoreCase(null, null));
  assertTrue(Utils.areStringsEqualIgnoreCase("", ""));
  assertFalse(Utils.areStringsEqualIgnoreCase("", "123"));
  assertFalse(Utils.areStringsEqualIgnoreCase("123", "456"));
  assertFalse(Utils.areStringsEqualIgnoreCase(null, ""));
  assertTrue(Utils.areStringsEqualIgnoreCase("bla", "bla"));
  assertTrue(Utils.areStringsEqualIgnoreCase("bla", "BLA"));
}

代码示例来源:origin: esig/dss

private boolean isMatch(CertificateWrapper trustedCert) {
  List<String> candidates = Arrays.asList(trustedCert.getOrganizationName(), trustedCert.getCommonName(), trustedCert.getOrganizationalUnit(),
      trustedCert.getCertificateDN());
  List<String> possibleMatchers = Arrays.asList(trustService.getTspName(), trustService.getServiceName());
  for (String candidate : candidates) {
    if (Utils.isStringBlank(candidate)) {
      continue;
    }
    for (String matcher : possibleMatchers) {
      if (Utils.areStringsEqualIgnoreCase(candidate, matcher)) {
        return true;
      }
    }
  }
  return false;
}

代码示例来源:origin: esig/dss

private Date extractExpirationDate(final String algorithm, CryptographicConstraint signatureCryptographicConstraint) {
  AlgoExpirationDate algoExpirationDate = signatureCryptographicConstraint.getAlgoExpirationDate();
  String dateFormat = DateUtils.DEFAULT_DATE_FORMAT;
  if (algoExpirationDate != null) {
    if (Utils.isStringNotEmpty(algoExpirationDate.getFormat())) {
      dateFormat = algoExpirationDate.getFormat();
    }
    List<Algo> algos = algoExpirationDate.getAlgo();
    String foundExpirationDate = null;
    for (Algo algo : algos) {
      if (Utils.areStringsEqualIgnoreCase(algo.getValue(), algorithm)) {
        foundExpirationDate = algo.getDate();
      }
    }
    if (Utils.isStringNotEmpty(foundExpirationDate)) {
      return DateUtils.parseDate(dateFormat, foundExpirationDate);
    }
  }
  return null;
}

相关文章