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

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

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

Arguments.mustBeCompatibleWithValue介绍

暂无

代码示例

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

public Least(
    XCriteriaBuilder criteriaBuilder,
    Expression<T> argument) {
  super(criteriaBuilder, argument);
  Arguments.mustBeCompatibleWithValue("argument.getJavaType()", argument.getJavaType(), Comparable.class);
}

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

public Greatest(
    XCriteriaBuilder criteriaBuilder,
    Expression<T> argument) {
  super(criteriaBuilder, argument);
  Arguments.mustBeCompatibleWithValue("argument.getJavaType()", argument.getJavaType(), Comparable.class);
}

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

private static ClassEnhancer getInstance0(
    Class<? extends ClassEnhancer> enhancerClass) {
  Arguments.mustNotBeNull("enhancerClass", enhancerClass);
  Arguments.mustBeCompatibleWithValue("enhancerClass", enhancerClass, ClassEnhancer.class);
  Arguments.mustNotBeAbstract("enhancerClass", enhancerClass);
  Constructor<? extends ClassEnhancer> constructor;
  try {
    constructor = enhancerClass.getDeclaredConstructor();
  } catch (NoSuchMethodException ex) {
    throw new IllegalArgumentException(
        mustSupportDefaultConstructor("enhancerClass", enhancerClass),
        ex
    );
  }
  constructor.setAccessible(true);
  try {
    return constructor.newInstance();
  } catch (InstantiationException ex) {
    throw UncheckedException.rethrow(ex);
  } catch (IllegalAccessException ex) {
    throw new AssertionError("Internal bug", ex);
  } catch (InvocationTargetException ex) {
    throw UncheckedException.rethrow(ex.getTargetException());
  }
}

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

private static ClassWrapper getInstance0(Class<? extends ClassWrapper> wrapperClass) {
  Arguments.mustNotBeNull("enhancerClass", wrapperClass);
  Arguments.mustBeCompatibleWithValue("wrapperClass", wrapperClass, ClassWrapper.class);
  Arguments.mustNotBeAbstract("wrapperClass", wrapperClass);
  Constructor<? extends ClassWrapper> constructor;
  try {
    constructor = wrapperClass.getDeclaredConstructor();
  } catch (NoSuchMethodException ex) {
    throw new IllegalArgumentException(
        mustSupportDefaultConstructor(wrapperClass),
        ex
    );
  }
  constructor.setAccessible(true);
  try {
    return constructor.newInstance();
  } catch (InstantiationException ex) {
    throw UncheckedException.rethrow(ex);
  } catch (IllegalAccessException ex) {
    throw new AssertionError("Internal bug", ex);
  } catch (InvocationTargetException ex) {
    throw UncheckedException.rethrow(ex.getTargetException());
  }
}

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

@SuppressWarnings({ "unchecked", "rawtypes" })
private static Object createInstance(Class<? extends Singleton> clazz) {
  Arguments.mustNotBeNull("clazz", clazz);
  Arguments.mustBeCompatibleWithValue("clazz", clazz, Singleton.class);
  Arguments.mustNotBeCompatibleWithValue("clazz", clazz, Externalizable.class);
  Arguments.mustNotBeAbstract("clazz", clazz);

相关文章