本文整理了Java中org.babyfish.lang.Arguments.mustBeLessThanOrEqualToValue()
方法的一些代码示例,展示了Arguments.mustBeLessThanOrEqualToValue()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Arguments.mustBeLessThanOrEqualToValue()
方法的具体详情如下:
包路径:org.babyfish.lang.Arguments
类名称:Arguments
方法名:mustBeLessThanOrEqualToValue
暂无
代码示例来源:origin: babyfish-ct/babyfish
@Override
public void validate(String e) {
Arguments.mustBeLessThanOrEqualToValue("e.length()", e.length(), this.maxLength);
}
代码示例来源:origin: babyfish-ct/babyfish
@Override
public void validate(Complex e) {
/*
* Need not to check whether the argument "e" is null.
* Except Validators.notNull(), no validators have chance to check null elements.
*/
if (this.builder != null) {
this.builder.append(this).append(" validate \"").append(e).append("\";");
}
Arguments.mustBeLessThanOrEqualToValue("e.getAbs()", e.getAbs(), this.maxAbs);
}
代码示例来源:origin: babyfish-ct/babyfish
@SuppressWarnings({ "unchecked", "rawtypes" })
public static <T> T mustBeLessThanOrEqualToValue(
String parameterName,
T argument,
T maximumValue,
Comparator<? super T> comparator) {
if (comparator == null) {
return (T)mustBeLessThanOrEqualToValue(parameterName, (Comparable)argument, (Comparable)maximumValue);
}
if (argument != null && maximumValue != null && comparator.compare(argument, maximumValue) > 0) {
throw new IllegalArgumentException(
mustBeGreaterThanValueMessage(parameterName, maximumValue.toString()));
}
return argument;
}
代码示例来源:origin: babyfish-ct/babyfish
public void modify(Date startTime, Date endTime) {
if (this.state != AnnualLeaveRequestState.CREATED) {
throw new IllegalStateException(
requestCanNotBeModified(this.state)
);
}
Arguments.mustNotBeNull("startTime", startTime);
Arguments.mustNotBeNull("endTime", endTime);
Arguments.mustBeGreaterThanOther("endTime", endTime, "startTime", startTime);
Arguments.mustBeLessThanOrEqualToValue(
"Time annual leave hours(endTime - startTime)",
(endTime.getTime() - startTime.getTime()) / (60 * 60 * 1000),
160
);
this.startTime = startTime;
this.endTime = endTime;
}
代码示例来源:origin: babyfish-ct/babyfish
keyEqualityComparator,
valueComparatorOrEqualityComparatorOrUnifiedComparator);
Arguments.mustBeLessThanOrEqualToValue("initCapacity", initCapacity, MAX_CAPACITY);
if (initCapacity < MIN_CAPACITY) {
initCapacity = MIN_CAPACITY;
代码示例来源:origin: babyfish-ct/babyfish
protected final void checkSubListRange(int subListHeadHide, int subListTailHide) {
Arguments.mustBeGreaterThanOrEqualToValue("subListHeadHide", subListHeadHide, 0);
Arguments.mustBeGreaterThanOrEqualToValue("subListTailHide", subListTailHide, 0);
Arguments.mustBeLessThanOrEqualToValue(
"subListHeadHide + subListTailHide",
subListHeadHide + subListTailHide,
this.allSize());
}
内容来源于网络,如有侵权,请联系作者删除!