org.babyfish.lang.Arguments.mustBeLessThanOrEqualToOther()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(121)

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

Arguments.mustBeLessThanOrEqualToOther介绍

暂无

代码示例

代码示例来源:origin: babyfish-ct/babyfish

@SuppressWarnings({ "unchecked", "rawtypes" })
public static <T> T mustBeLessThanOrEqualToOther(
    String parameterName,
    T argument,
    String maximumParameterName,
    T maximumValue,
    Comparator<? super T> comparator) {
  if (comparator == null) {
    return (T)mustBeLessThanOrEqualToOther(
        parameterName, 
        (Comparable)argument, 
        maximumParameterName, 
        (Comparable)maximumValue);
  }
  if (argument != null && maximumValue != null && comparator.compare(argument, maximumValue) > 0) {
    throw new IllegalArgumentException(
        mustBeGreaterThanOtherMessage(parameterName, maximumParameterName));
  }
  return argument;
}

代码示例来源:origin: babyfish-ct/babyfish

public static LazyBehaviorProcessor of(int rowLimit, int countLimit) {
  Arguments.mustBeGreaterThanOrEqualToValue("rowLimit", rowLimit, 0);
  Arguments.mustBeGreaterThanOrEqualToValue("countLimit", rowLimit, 0);
  Arguments.mustBeLessThanOrEqualToOther("countLimit", countLimit, "rowLimit", rowLimit);
  if (rowLimit == 0 && countLimit == 0) {
    return DISABLED;
  }
  return new Normal(rowLimit, countLimit);
}

相关文章