本文整理了Java中ch.qos.logback.core.util.Duration.buildByMinutes()
方法的一些代码示例,展示了Duration.buildByMinutes()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Duration.buildByMinutes()
方法的具体详情如下:
包路径:ch.qos.logback.core.util.Duration
类名称:Duration
方法名:buildByMinutes
暂无
代码示例来源:origin: camunda/camunda-bpm-platform
public static Duration valueOf(String durationStr) {
Matcher matcher = DURATION_PATTERN.matcher(durationStr);
if (matcher.matches()) {
String doubleStr = matcher.group(DOUBLE_GROUP);
String unitStr = matcher.group(UNIT_GROUP);
double doubleValue = Double.valueOf(doubleStr);
if (unitStr.equalsIgnoreCase("milli")
|| unitStr.equalsIgnoreCase("millisecond") || unitStr.length() == 0) {
return buildByMilliseconds(doubleValue);
} else if (unitStr.equalsIgnoreCase("second")
|| unitStr.equalsIgnoreCase("seconde")) {
return buildBySeconds(doubleValue);
} else if (unitStr.equalsIgnoreCase("minute")) {
return buildByMinutes(doubleValue);
} else if (unitStr.equalsIgnoreCase("hour")) {
return buildByHours(doubleValue);
} else if (unitStr.equalsIgnoreCase("day")) {
return buildByDays(doubleValue);
} else {
throw new IllegalStateException("Unexpected " + unitStr);
}
} else {
throw new IllegalArgumentException("String value [" + durationStr
+ "] is not in the expected format.");
}
}
代码示例来源:origin: tony19/logback-android
public static Duration valueOf(String durationStr) {
Matcher matcher = DURATION_PATTERN.matcher(durationStr);
if (matcher.matches()) {
String doubleStr = matcher.group(DOUBLE_GROUP);
String unitStr = matcher.group(UNIT_GROUP);
double doubleValue = Double.valueOf(doubleStr);
if (unitStr.equalsIgnoreCase("milli")
|| unitStr.equalsIgnoreCase("millisecond") || unitStr.length() == 0) {
return buildByMilliseconds(doubleValue);
} else if (unitStr.equalsIgnoreCase("second")
|| unitStr.equalsIgnoreCase("seconde")) {
return buildBySeconds(doubleValue);
} else if (unitStr.equalsIgnoreCase("minute")) {
return buildByMinutes(doubleValue);
} else if (unitStr.equalsIgnoreCase("hour")) {
return buildByHours(doubleValue);
} else if (unitStr.equalsIgnoreCase("day")) {
return buildByDays(doubleValue);
} else {
throw new IllegalStateException("Unexpected " + unitStr);
}
} else {
throw new IllegalArgumentException("String value [" + durationStr
+ "] is not in the expected format.");
}
}
代码示例来源:origin: io.virtdata/virtdata-lib-realer
public static Duration valueOf(String durationStr) {
Matcher matcher = DURATION_PATTERN.matcher(durationStr);
if (matcher.matches()) {
String doubleStr = matcher.group(DOUBLE_GROUP);
String unitStr = matcher.group(UNIT_GROUP);
double doubleValue = Double.valueOf(doubleStr);
if (unitStr.equalsIgnoreCase("milli") || unitStr.equalsIgnoreCase("millisecond") || unitStr.length() == 0) {
return buildByMilliseconds(doubleValue);
} else if (unitStr.equalsIgnoreCase("second") || unitStr.equalsIgnoreCase("seconde")) {
return buildBySeconds(doubleValue);
} else if (unitStr.equalsIgnoreCase("minute")) {
return buildByMinutes(doubleValue);
} else if (unitStr.equalsIgnoreCase("hour")) {
return buildByHours(doubleValue);
} else if (unitStr.equalsIgnoreCase("day")) {
return buildByDays(doubleValue);
} else {
throw new IllegalStateException("Unexpected " + unitStr);
}
} else {
throw new IllegalArgumentException("String value [" + durationStr + "] is not in the expected format.");
}
}
代码示例来源:origin: Nextdoor/bender
public static Duration valueOf(String durationStr) {
Matcher matcher = DURATION_PATTERN.matcher(durationStr);
if (matcher.matches()) {
String doubleStr = matcher.group(DOUBLE_GROUP);
String unitStr = matcher.group(UNIT_GROUP);
double doubleValue = Double.valueOf(doubleStr);
if (unitStr.equalsIgnoreCase("milli") || unitStr.equalsIgnoreCase("millisecond") || unitStr.length() == 0) {
return buildByMilliseconds(doubleValue);
} else if (unitStr.equalsIgnoreCase("second") || unitStr.equalsIgnoreCase("seconde")) {
return buildBySeconds(doubleValue);
} else if (unitStr.equalsIgnoreCase("minute")) {
return buildByMinutes(doubleValue);
} else if (unitStr.equalsIgnoreCase("hour")) {
return buildByHours(doubleValue);
} else if (unitStr.equalsIgnoreCase("day")) {
return buildByDays(doubleValue);
} else {
throw new IllegalStateException("Unexpected " + unitStr);
}
} else {
throw new IllegalArgumentException("String value [" + durationStr + "] is not in the expected format.");
}
}
代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded
public static Duration valueOf(String durationStr) {
Matcher matcher = DURATION_PATTERN.matcher(durationStr);
if (matcher.matches()) {
String doubleStr = matcher.group(DOUBLE_GROUP);
String unitStr = matcher.group(UNIT_GROUP);
double doubleValue = Double.valueOf(doubleStr);
if (unitStr.equalsIgnoreCase("milli") || unitStr.equalsIgnoreCase("millisecond") || unitStr.length() == 0) {
return buildByMilliseconds(doubleValue);
} else if (unitStr.equalsIgnoreCase("second") || unitStr.equalsIgnoreCase("seconde")) {
return buildBySeconds(doubleValue);
} else if (unitStr.equalsIgnoreCase("minute")) {
return buildByMinutes(doubleValue);
} else if (unitStr.equalsIgnoreCase("hour")) {
return buildByHours(doubleValue);
} else if (unitStr.equalsIgnoreCase("day")) {
return buildByDays(doubleValue);
} else {
throw new IllegalStateException("Unexpected " + unitStr);
}
} else {
throw new IllegalArgumentException("String value [" + durationStr + "] is not in the expected format.");
}
}
代码示例来源:origin: ch.qos.logback/core
public static Duration valueOf(String durationStr) {
Matcher matcher = DURATION_PATTERN.matcher(durationStr);
if (matcher.matches()) {
String doubleStr = matcher.group(DOUBLE_GROUP);
String unitStr = matcher.group(UNIT_GROUP);
double doubleValue = Double.valueOf(doubleStr);
if (unitStr.equalsIgnoreCase("milli")
|| unitStr.equalsIgnoreCase("millisecond") || unitStr.length() == 0) {
return buildByMilliseconds(doubleValue);
} else if (unitStr.equalsIgnoreCase("second")
|| unitStr.equalsIgnoreCase("seconde")) {
return buildBySeconds(doubleValue);
} else if (unitStr.equalsIgnoreCase("minute")) {
return buildByMinutes(doubleValue);
} else if (unitStr.equalsIgnoreCase("hour")) {
return buildByHours(doubleValue);
} else if (unitStr.equalsIgnoreCase("day")) {
return buildByDays(doubleValue);
} else {
throw new IllegalStateException("Unexpected " + unitStr);
}
} else {
throw new IllegalArgumentException("String value [" + durationStr
+ "] is not in the expected format.");
}
}
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/ch.qos.logback.core
public static Duration valueOf(String durationStr) {
Matcher matcher = DURATION_PATTERN.matcher(durationStr);
if (matcher.matches()) {
String doubleStr = matcher.group(DOUBLE_GROUP);
String unitStr = matcher.group(UNIT_GROUP);
double doubleValue = Double.valueOf(doubleStr);
if (unitStr.equalsIgnoreCase("milli")
|| unitStr.equalsIgnoreCase("millisecond") || unitStr.length() == 0) {
return buildByMilliseconds(doubleValue);
} else if (unitStr.equalsIgnoreCase("second")
|| unitStr.equalsIgnoreCase("seconde")) {
return buildBySeconds(doubleValue);
} else if (unitStr.equalsIgnoreCase("minute")) {
return buildByMinutes(doubleValue);
} else if (unitStr.equalsIgnoreCase("hour")) {
return buildByHours(doubleValue);
} else if (unitStr.equalsIgnoreCase("day")) {
return buildByDays(doubleValue);
} else {
throw new IllegalStateException("Unexpected " + unitStr);
}
} else {
throw new IllegalArgumentException("String value [" + durationStr
+ "] is not in the expected format.");
}
}
代码示例来源:origin: com.alibaba.citrus.tool/antx-autoexpand
public static Duration valueOf(String durationStr) {
Matcher matcher = DURATION_PATTERN.matcher(durationStr);
if (matcher.matches()) {
String doubleStr = matcher.group(DOUBLE_GROUP);
String unitStr = matcher.group(UNIT_GROUP);
double doubleValue = Double.valueOf(doubleStr);
if (unitStr.equalsIgnoreCase("milli")
|| unitStr.equalsIgnoreCase("millisecond") || unitStr.length() == 0) {
return buildByMilliseconds(doubleValue);
} else if (unitStr.equalsIgnoreCase("second")
|| unitStr.equalsIgnoreCase("seconde")) {
return buildBySeconds(doubleValue);
} else if (unitStr.equalsIgnoreCase("minute")) {
return buildByMinutes(doubleValue);
} else if (unitStr.equalsIgnoreCase("hour")) {
return buildByHours(doubleValue);
} else if (unitStr.equalsIgnoreCase("day")) {
return buildByDays(doubleValue);
} else {
throw new IllegalStateException("Unexpected " + unitStr);
}
} else {
throw new IllegalArgumentException("String value [" + durationStr
+ "] is not in the expected format.");
}
}
代码示例来源:origin: com.hynnet/logback-core
public static Duration valueOf(String durationStr) {
Matcher matcher = DURATION_PATTERN.matcher(durationStr);
if (matcher.matches()) {
String doubleStr = matcher.group(DOUBLE_GROUP);
String unitStr = matcher.group(UNIT_GROUP);
double doubleValue = Double.valueOf(doubleStr);
if (unitStr.equalsIgnoreCase("milli")
|| unitStr.equalsIgnoreCase("millisecond") || unitStr.length() == 0) {
return buildByMilliseconds(doubleValue);
} else if (unitStr.equalsIgnoreCase("second")
|| unitStr.equalsIgnoreCase("seconde")) {
return buildBySeconds(doubleValue);
} else if (unitStr.equalsIgnoreCase("minute")) {
return buildByMinutes(doubleValue);
} else if (unitStr.equalsIgnoreCase("hour")) {
return buildByHours(doubleValue);
} else if (unitStr.equalsIgnoreCase("day")) {
return buildByDays(doubleValue);
} else {
throw new IllegalStateException("Unexpected " + unitStr);
}
} else {
throw new IllegalArgumentException("String value [" + durationStr
+ "] is not in the expected format.");
}
}
内容来源于网络,如有侵权,请联系作者删除!