本文整理汇总了Java中org.apache.commons.lang.StringUtils.uncapitalize方法的典型用法代码示例。如果您正苦于以下问题:Java StringUtils.uncapitalize方法的具体用法?Java StringUtils.uncapitalize怎么用?Java StringUtils.uncapitalize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.lang.StringUtils
的用法示例。
在下文中一共展示了StringUtils.uncapitalize方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: MutableStat
import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
/**
* Construct a sample statistics metric
* @param name of the metric
* @param description of the metric
* @param sampleName of the metric (e.g. "Ops")
* @param valueName of the metric (e.g. "Time", "Latency")
* @param extended create extended stats (stdev, min/max etc.) by default.
*/
public MutableStat(String name, String description,
String sampleName, String valueName, boolean extended) {
String ucName = StringUtils.capitalize(name);
String usName = StringUtils.capitalize(sampleName);
String uvName = StringUtils.capitalize(valueName);
String desc = StringUtils.uncapitalize(description);
String lsName = StringUtils.uncapitalize(sampleName);
String lvName = StringUtils.uncapitalize(valueName);
numInfo = info(ucName +"Num"+ usName, "Number of "+ lsName +" for "+ desc);
iNumInfo = info(ucName +"INum"+ usName,
"Interval number of "+ lsName +" for "+ desc);
avgInfo = info(ucName +"Avg"+ uvName, "Average "+ lvName +" for "+ desc);
stdevInfo = info(ucName +"Stdev"+ uvName,
"Standard deviation of "+ lvName +" for "+ desc);
iMinInfo = info(ucName +"IMin"+ uvName,
"Interval min "+ lvName +" for "+ desc);
iMaxInfo = info(ucName + "IMax"+ uvName,
"Interval max "+ lvName +" for "+ desc);
minInfo = info(ucName +"Min"+ uvName, "Min "+ lvName +" for "+ desc);
maxInfo = info(ucName +"Max"+ uvName, "Max "+ lvName +" for "+ desc);
this.extended = extended;
}
示例2: MutableStat
import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
/**
* Construct a sample statistics metric
* @param name of the metric
* @param description of the metric
* @param sampleName of the metric (e.g. "Ops")
* @param valueName of the metric (e.g. "Time", "Latency")
* @param extended create extended stats (stdev, min/max etc.) by default.
*/
public MutableStat(String name, String description,
String sampleName, String valueName, boolean extended) {
String ucName = StringUtils.capitalize(name);
String usName = StringUtils.capitalize(sampleName);
String uvName = StringUtils.capitalize(valueName);
String desc = StringUtils.uncapitalize(description);
String lsName = StringUtils.uncapitalize(sampleName);
String lvName = StringUtils.uncapitalize(valueName);
numInfo = info(ucName +"Num"+ usName, "Number of "+ lsName +" for "+ desc);
avgInfo = info(ucName +"Avg"+ uvName, "Average "+ lvName +" for "+ desc);
stdevInfo = info(ucName +"Stdev"+ uvName,
"Standard deviation of "+ lvName +" for "+ desc);
iMinInfo = info(ucName +"IMin"+ uvName,
"Interval min "+ lvName +" for "+ desc);
iMaxInfo = info(ucName + "IMax"+ uvName,
"Interval max "+ lvName +" for "+ desc);
minInfo = info(ucName +"Min"+ uvName, "Min "+ lvName +" for "+ desc);
maxInfo = info(ucName +"Max"+ uvName, "Max "+ lvName +" for "+ desc);
this.extended = extended;
}
示例3: apply
import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
public void apply(String taskName) {
if (taskName.startsWith(PREFIX)) {
String configurationName = StringUtils.uncapitalize(taskName.substring(PREFIX.length()));
Configuration configuration = configurations.findByName(configurationName);
if (configuration != null) {
Task task = tasks.create(taskName);
task.dependsOn(configuration.getAllArtifacts());
task.setDescription("Builds the artifacts belonging to " + configuration + ".");
}
}
}
示例4: MutableQuantiles
import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
/**
* Instantiates a new {@link MutableQuantiles} for a metric that rolls itself
* over on the specified time interval.
*
* @param name
* of the metric
* @param description
* long-form textual description of the metric
* @param sampleName
* type of items in the stream (e.g., "Ops")
* @param valueName
* type of the values
* @param interval
* rollover interval (in seconds) of the estimator
*/
public MutableQuantiles(String name, String description, String sampleName,
String valueName, int interval) {
String ucName = StringUtils.capitalize(name);
String usName = StringUtils.capitalize(sampleName);
String uvName = StringUtils.capitalize(valueName);
String desc = StringUtils.uncapitalize(description);
String lsName = StringUtils.uncapitalize(sampleName);
String lvName = StringUtils.uncapitalize(valueName);
numInfo = info(ucName + "Num" + usName, String.format(
"Number of %s for %s with %ds interval", lsName, desc, interval));
// Construct the MetricsInfos for the quantiles, converting to percentiles
quantileInfos = new MetricsInfo[quantiles.length];
String nameTemplate = ucName + "%dthPercentile" + uvName;
String descTemplate = "%d percentile " + lvName + " with " + interval
+ " second interval for " + desc;
for (int i = 0; i < quantiles.length; i++) {
int percentile = (int) (100 * quantiles[i].quantile);
quantileInfos[i] = info(String.format(nameTemplate, percentile),
String.format(descTemplate, percentile));
}
estimator = new SampleQuantiles(quantiles);
this.interval = interval;
scheduler.scheduleAtFixedRate(new RolloverSample(this), interval, interval,
TimeUnit.SECONDS);
}
示例5: prepareNameString
import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
/**
* Prepare camelcase name
*
* @param nameString string to convert to camel case
* @return camelcase string
*/
public static String prepareNameString(String nameString) {
nameString = underscores(nameString).replaceAll("\\W", "_").toLowerCase();
nameString = Arrays.stream(nameString.split("_")).map(StringUtils::capitalize).collect(Collectors.joining());
nameString = StringUtils.uncapitalize(nameString);
return nameString;
}
示例6: MutableHistogram
import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
public MutableHistogram(String name, String description) {
this.name = StringUtils.capitalize(name);
this.desc = StringUtils.uncapitalize(description);
sample = new ExponentiallyDecayingSample(DEFAULT_SAMPLE_SIZE, DEFAULT_ALPHA);
count = new AtomicLong();
min = new AtomicLong(Long.MAX_VALUE);
max = new AtomicLong(Long.MIN_VALUE);
sum = new AtomicLong();
}
示例7: MetricMutableQuantiles
import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
/**
* Instantiates a new {@link MetricMutableQuantiles} for a metric that rolls itself over on the
* specified time interval.
*
* @param name of the metric
* @param description long-form textual description of the metric
* @param sampleName type of items in the stream (e.g., "Ops")
* @param valueName type of the values
* @param interval rollover interval (in seconds) of the estimator
*/
public MetricMutableQuantiles(String name, String description, String sampleName,
String valueName, int interval) {
String ucName = StringUtils.capitalize(name);
String usName = StringUtils.capitalize(sampleName);
String uvName = StringUtils.capitalize(valueName);
String desc = StringUtils.uncapitalize(description);
String lsName = StringUtils.uncapitalize(sampleName);
String lvName = StringUtils.uncapitalize(valueName);
numInfo = info(ucName + "Num" + usName, String.format(
"Number of %s for %s with %ds interval", lsName, desc, interval));
// Construct the MetricsInfos for the quantiles, converting to percentiles
quantileInfos = new MetricsInfo[quantiles.length];
String nameTemplate = "%s%dthPercentile%dsInterval%s";
String descTemplate = "%d percentile %s with %d second interval for %s";
for (int i = 0; i < quantiles.length; i++) {
int percentile = (int) (100 * quantiles[i].quantile);
quantileInfos[i] = info(String.format(nameTemplate, ucName, percentile, interval, uvName),
String.format(descTemplate, percentile, lvName, interval, desc));
}
estimator = new MetricSampleQuantiles(quantiles);
executor = new MetricsExecutorImpl();
this.interval = interval;
executor.getExecutor().scheduleAtFixedRate(new RolloverSample(this),
interval,
interval,
TimeUnit.SECONDS);
}
示例8: createHeader
import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
@Override
protected String createHeader(Project project) {
String header = super.createHeader(project);
return "All tasks runnable from " + StringUtils.uncapitalize(header);
}
示例9: getCompileConfigurationName
import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
public String getCompileConfigurationName() {
return StringUtils.uncapitalize(getTaskBaseName() + "Compile");
}
示例10: getRuntimeConfigurationName
import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
public String getRuntimeConfigurationName() {
return StringUtils.uncapitalize(getTaskBaseName() + "Runtime");
}
示例11: getCompileOnlyConfigurationName
import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
public String getCompileOnlyConfigurationName() {
return StringUtils.uncapitalize(getTaskBaseName() + "CompileOnly");
}
示例12: getCompileClasspathConfigurationName
import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
@Override
public String getCompileClasspathConfigurationName() {
return StringUtils.uncapitalize(getTaskBaseName() + "CompileClasspath");
}
示例13: getStrutsForwardNameFromPath
import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
/**
* <p>
* This helper method create the struts action forward name using the path. It will chop all path related
* characters, such as "/" and ".do".
* </p>
*
* <p>
* For example:
* <li><code>getStrutsForwardNameFromPath("/DisplayParallelActivity.do")<code>
* = displayParallelActivity</li>
* </p>
*
* @param path
* @return
*/
public static String getStrutsForwardNameFromPath(String path) {
String pathWithoutSlash = StringUtils.substringAfter(path, "/");
String orginalForwardName = StringUtils.substringBeforeLast(pathWithoutSlash, ".do");
return StringUtils.uncapitalize(orginalForwardName);
}