本文整理了Java中org.springframework.util.Assert.assignableCheckFailed()
方法的一些代码示例,展示了Assert.assignableCheckFailed()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Assert.assignableCheckFailed()
方法的具体详情如下:
包路径:org.springframework.util.Assert
类名称: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, () -> "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, () -> "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, () -> "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));
内容来源于网络,如有侵权,请联系作者删除!