本文整理了Java中org.apache.commons.lang3.StringUtils.lowerCase()
方法的一些代码示例,展示了StringUtils.lowerCase()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。StringUtils.lowerCase()
方法的具体详情如下:
包路径:org.apache.commons.lang3.StringUtils
类名称:StringUtils
方法名:lowerCase
StringUtils.lowerCase介绍
[英]Converts a String to lower case as per String#toLowerCase().
A null input String returns null.
StringUtils.lowerCase(null) = null
StringUtils.lowerCase("") = ""
StringUtils.lowerCase("aBc") = "abc"
Note: As described in the documentation for String#toLowerCase(), the result of this method is affected by the current locale. For platform-independent case transformations, the method #lowerCase(String,Locale)should be used with a specific locale (e.g. Locale#ENGLISH).
[中]根据字符串#toLowerCase()将字符串转换为小写。
空输入字符串返回空值。
StringUtils.lowerCase(null) = null
StringUtils.lowerCase("") = ""
StringUtils.lowerCase("aBc") = "abc"
注意:如String#toLowerCase()文档中所述,此方法的结果受当前区域设置的影响。对于独立于平台的大小写转换,方法#小写(字符串,区域设置)应与特定区域设置(例如,区域设置#英语)一起使用。
代码示例
代码示例来源:origin: Graylog2/graylog2-server
@Override
protected String apply(String value, Locale locale) {
return StringUtils.lowerCase(value, locale);
}
}
代码示例来源:origin: apache/geode
Status(final String description) {
assert isNotBlank(description) : "The Status description must be specified!";
this.description = lowerCase(description);
}
代码示例来源:origin: apache/hive
/**
* If the URI has no scheme defined, the default is {@link UriType#FILE}
*/
private static ResourceDownloader.UriType getURLType(URI value) {
String scheme = StringUtils.lowerCase(value.getScheme());
if (scheme == null) return UriType.FILE;
if ("file".equals(scheme)) return UriType.FILE;
if ("hdfs".equals(scheme)) return UriType.HDFS;
if ("ivy".equals(scheme)) return UriType.IVY;
return UriType.OTHER;
}
}
代码示例来源:origin: jeremylong/DependencyCheck
/**
* Implements the hashCode for Evidence.
*
* @return hash code.
*/
@Override
public int hashCode() {
return new HashCodeBuilder(MAGIC_HASH_INIT_VALUE, MAGIC_HASH_MULTIPLIER)
.append(StringUtils.lowerCase(name))
.append(StringUtils.lowerCase(source))
.append(StringUtils.lowerCase(value))
.append(confidence)
.toHashCode();
}
代码示例来源:origin: liferay/liferay-portal
private String _replaceHttpSchemeWithHttps(String url) {
String lowerCasedUrl = StringUtils.lowerCase(url);
if (lowerCasedUrl.startsWith(HTTP)) {
return HTTPS.concat(url.substring(HTTP.length()));
}
return url;
}
代码示例来源:origin: apache/geode
/**
* Determines whether this Locator launcher command has the specified command-line option.
*
* @param option a String indicating the name of the command-line option to this command.
* @return a boolean value indicating whether this command has the specified named command-line
* option.
*/
public boolean hasOption(final String option) {
return getOptions().contains(lowerCase(option));
}
代码示例来源:origin: apache/geode
/**
* Determines whether this Server launcher command has the specified command-line option.
*
* @param option a String indicating the name of the command-line option to this command.
* @return a boolean value indicating whether this command has the specified named command-line
* option.
*/
public boolean hasOption(final String option) {
return getOptions().contains(lowerCase(option));
}
代码示例来源:origin: org.apache.commons/commons-lang3
@Test
public void testLowerCase() {
assertNull(StringUtils.lowerCase(null));
assertNull(StringUtils.lowerCase(null, Locale.ENGLISH));
assertEquals("lowerCase(String) failed",
"foo test thing", StringUtils.lowerCase("fOo test THING"));
assertEquals("lowerCase(empty-string) failed",
"", StringUtils.lowerCase(""));
assertEquals("lowerCase(String, Locale) failed",
"foo test thing", StringUtils.lowerCase("fOo test THING", Locale.ENGLISH));
assertEquals("lowerCase(empty-string, Locale) failed",
"", StringUtils.lowerCase("", Locale.ENGLISH));
}
代码示例来源:origin: zhegexiaohuozi/SeimiCrawler
Request request = new Request();
String[] urlPies = url.split("##");
if (urlPies.length >= 2 && StringUtils.lowerCase(urlPies[1]).equals("post")) {
request.setHttpMethod(HttpMethod.POST);
代码示例来源:origin: spring-projects/spring-roo
private StringBuilder getBasePathStringBuilder(ClassOrInterfaceTypeDetails controller,
ControllerAnnotationValues values) {
StringBuilder sbuilder = new StringBuilder("/");
String prefix = StringUtils.trim(values.getPathPrefix());
final JavaType entity = values.getEntity();
// Add prefix
if (StringUtils.isNotBlank(prefix)) {
if (prefix.startsWith("/")) {
sbuilder.append(prefix.substring(1));
} else {
sbuilder.append(prefix);
}
// Include last / if provided prefix doesn't include it
if (!prefix.endsWith("/")) {
sbuilder.append("/");
}
}
// add Entity
sbuilder.append(StringUtils.lowerCase(getPluralService().getPlural(entity)));
return sbuilder;
}
代码示例来源:origin: rancher/cattle
private String convertResourceType(String type) {
switch (StringUtils.lowerCase(type)) {
case "environment":
return "stack";
case "project":
return "environment";
default:
return type;
}
}
代码示例来源:origin: org.apereo.service.persondir/person-directory-impl
@Override
public String canonicalize(final String value, final Locale locale) {
return StringUtils.lowerCase(value, locale);
}
},
代码示例来源:origin: spring-projects/spring-roo
pathPrefix = StringUtils.lowerCase(pathPrefix);
代码示例来源:origin: iterate-ch/cyberduck
@Override
public String getMime(final String filename) {
if(StringUtils.startsWith(filename, "._")) {
return DEFAULT_CONTENT_TYPE;
}
// Reads from mime.types in classpath
return types.getMimetype(StringUtils.lowerCase(filename));
}
}
代码示例来源:origin: DSpace/DSpace
/**
* Set the EPerson's email
*
* @param s the new email
*/
public void setEmail(String s) {
this.email = StringUtils.lowerCase(s);
setModified();
}
代码示例来源:origin: Devskiller/jfairy
@Override
public void generateUsername() {
if (username != null) {
return;
}
if (baseProducer.trueOrFalse()) {
username = lowerCase(stripAccents(firstName.substring(0, 1) + lastName));
} else {
username = lowerCase(stripAccents(firstName + lastName.substring(0, 1)));
}
}
代码示例来源:origin: iterate-ch/cyberduck
@Override
public boolean accept(Host host) {
return StringUtils.lowerCase(BookmarkNameProvider.toString(host)).contains(searchString.toLowerCase(Locale.ROOT))
|| ((null != host.getComment()) && StringUtils.lowerCase(host.getComment()).contains(searchString.toLowerCase(Locale.ROOT)))
|| ((null != host.getCredentials().getUsername()) && StringUtils.lowerCase(host.getCredentials().getUsername()).contains(searchString.toLowerCase(Locale.ROOT)))
|| StringUtils.lowerCase(host.getHostname()).contains(searchString.toLowerCase(Locale.ROOT));
}
});
代码示例来源:origin: info.magnolia/magnolia-core
private JcrPropertySupportingConstructor(ValueFactory valueFactory) {
yamlConstructors.put(new Tag("!" + StringUtils.lowerCase(PropertyType.TYPENAME_PATH)), new JcrConstruct(PropertyType.PATH, valueFactory));
yamlConstructors.put(new Tag("!" + StringUtils.lowerCase(PropertyType.TYPENAME_URI)), new JcrConstruct(PropertyType.URI, valueFactory));
yamlConstructors.put(new Tag("!" + StringUtils.lowerCase(PropertyType.TYPENAME_REFERENCE)), new JcrConstruct(PropertyType.REFERENCE, valueFactory));
yamlConstructors.put(new Tag("!" + StringUtils.lowerCase(PropertyType.TYPENAME_WEAKREFERENCE)), new JcrConstruct(PropertyType.WEAKREFERENCE, valueFactory));
yamlConstructors.put(new Tag("!" + StringUtils.lowerCase(PropertyType.TYPENAME_BINARY)), new JcrConstruct(PropertyType.BINARY, valueFactory));
}
}
代码示例来源:origin: Devskiller/jfairy
@Override
public String get() {
return TextUtils.stripAccents(lowerCase(firstName + '.' + lastName + '@' + company.getDomain())).replaceAll(" ", ".");
}
}
代码示例来源:origin: rancher/cattle
@Override
public void fetchEnvironment(final MetaHelperInfo helperInfo, final OutputStream os) {
Account env = helperInfo.getAccount();
EnvironmentMetaData data = new EnvironmentMetaData(StringUtils.lowerCase(env.getName()), env.getUuid(), StringUtils.lowerCase(helperInfo.getRegionName()));
writeToJson(os, data);
}