org.springframework.util.Assert.assignableCheckFailed()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(6.3k)|赞(0)|评价(0)|浏览(168)

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

Assert.assignableCheckFailed介绍

暂无

代码示例

代码示例来源:origin: spring-projects/spring-framework

/**
 * Assert that {@code superType.isAssignableFrom(subType)} is {@code true}.
 * <pre class="code">Assert.isAssignable(Number.class, myClass, "Number expected");</pre>
 * @param superType the super type to check against
 * @param subType the sub type to check
 * @param message a message which will be prepended to provide further context.
 * If it is empty or ends in ":" or ";" or "," or ".", a full exception message
 * will be appended. If it ends in a space, the name of the offending sub type
 * will be appended. In any other case, a ":" with a space and the name of the
 * offending sub type will be appended.
 * @throws IllegalArgumentException if the classes are not assignable
 */
public static void isAssignable(Class<?> superType, @Nullable Class<?> subType, String message) {
  notNull(superType, "Super type to check against must not be null");
  if (subType == null || !superType.isAssignableFrom(subType)) {
    assignableCheckFailed(superType, subType, message);
  }
}

代码示例来源:origin: spring-projects/spring-framework

/**
 * Assert that {@code superType.isAssignableFrom(subType)} is {@code true}.
 * <pre class="code">
 * Assert.isAssignable(Number.class, myClass, () -&gt; "Processing " + myAttributeName + ":");
 * </pre>
 * @param superType the super type to check against
 * @param subType the sub type to check
 * @param messageSupplier a supplier for the exception message to use if the
 * assertion fails. See {@link #isAssignable(Class, Class, String)} for details.
 * @throws IllegalArgumentException if the classes are not assignable
 * @since 5.0
 */
public static void isAssignable(Class<?> superType, @Nullable Class<?> subType, Supplier<String> messageSupplier) {
  notNull(superType, "Super type to check against must not be null");
  if (subType == null || !superType.isAssignableFrom(subType)) {
    assignableCheckFailed(superType, subType, nullSafeGet(messageSupplier));
  }
}

代码示例来源:origin: org.springframework/spring-core

/**
 * Assert that {@code superType.isAssignableFrom(subType)} is {@code true}.
 * <pre class="code">Assert.isAssignable(Number.class, myClass, "Number expected");</pre>
 * @param superType the super type to check against
 * @param subType the sub type to check
 * @param message a message which will be prepended to provide further context.
 * If it is empty or ends in ":" or ";" or "," or ".", a full exception message
 * will be appended. If it ends in a space, the name of the offending sub type
 * will be appended. In any other case, a ":" with a space and the name of the
 * offending sub type will be appended.
 * @throws IllegalArgumentException if the classes are not assignable
 */
public static void isAssignable(Class<?> superType, @Nullable Class<?> subType, String message) {
  notNull(superType, "Super type to check against must not be null");
  if (subType == null || !superType.isAssignableFrom(subType)) {
    assignableCheckFailed(superType, subType, message);
  }
}

代码示例来源:origin: org.springframework/spring-core

/**
 * Assert that {@code superType.isAssignableFrom(subType)} is {@code true}.
 * <pre class="code">
 * Assert.isAssignable(Number.class, myClass, () -&gt; "Processing " + myAttributeName + ":");
 * </pre>
 * @param superType the super type to check against
 * @param subType the sub type to check
 * @param messageSupplier a supplier for the exception message to use if the
 * assertion fails. See {@link #isAssignable(Class, Class, String)} for details.
 * @throws IllegalArgumentException if the classes are not assignable
 * @since 5.0
 */
public static void isAssignable(Class<?> superType, @Nullable Class<?> subType, Supplier<String> messageSupplier) {
  notNull(superType, "Super type to check against must not be null");
  if (subType == null || !superType.isAssignableFrom(subType)) {
    assignableCheckFailed(superType, subType, nullSafeGet(messageSupplier));
  }
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-core

/**
 * Assert that {@code superType.isAssignableFrom(subType)} is {@code true}.
 * <pre class="code">Assert.isAssignable(Number.class, myClass, "Number expected");</pre>
 * @param superType the super type to check against
 * @param subType the sub type to check
 * @param message a message which will be prepended to provide further context.
 * If it is empty or ends in ":" or ";" or "," or ".", a full exception message
 * will be appended. If it ends in a space, the name of the offending sub type
 * will be appended. In any other case, a ":" with a space and the name of the
 * offending sub type will be appended.
 * @throws IllegalArgumentException if the classes are not assignable
 */
public static void isAssignable(Class<?> superType, @Nullable Class<?> subType, String message) {
  notNull(superType, "Super type to check against must not be null");
  if (subType == null || !superType.isAssignableFrom(subType)) {
    assignableCheckFailed(superType, subType, message);
  }
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-core

/**
 * Assert that {@code superType.isAssignableFrom(subType)} is {@code true}.
 * <pre class="code">
 * Assert.isAssignable(Number.class, myClass, () -&gt; "Processing " + myAttributeName + ":");
 * </pre>
 * @param superType the super type to check against
 * @param subType the sub type to check
 * @param messageSupplier a supplier for the exception message to use if the
 * assertion fails. See {@link #isAssignable(Class, Class, String)} for details.
 * @throws IllegalArgumentException if the classes are not assignable
 * @since 5.0
 */
public static void isAssignable(Class<?> superType, @Nullable Class<?> subType, Supplier<String> messageSupplier) {
  notNull(superType, "Super type to check against must not be null");
  if (subType == null || !superType.isAssignableFrom(subType)) {
    assignableCheckFailed(superType, subType, nullSafeGet(messageSupplier));
  }
}

代码示例来源:origin: apache/servicemix-bundles

notNull(superType, "Super type to check against must not be null");
if (subType == null || !superType.isAssignableFrom(subType)) {
  assignableCheckFailed(superType, subType, message);
notNull(superType, "Super type to check against must not be null");
if (subType == null || !superType.isAssignableFrom(subType)) {
  assignableCheckFailed(superType, subType, nullSafeGet(messageSupplier));

相关文章