public final class ConversionUtils extends Object
ConversionService相关工具SpringUtils,
ConversionServicepublic static boolean canConverter(Class<?> sourceType, Class<?> targetType)
sourceType - 源类型targetType - 目标类型UnsupportedOperationException - 无法定位ApplicationContext实例@Nullable public static <T> T convert(Object source, Class<T> targetType)
T - 目标类型泛型source - 源对象实例targetType - 目标类型UnsupportedOperationException - 无法定位ApplicationContext实例public static <T> T convertOrThrow(Object source, Class<T> targetType)
T - 目标类型泛型source - 源对象实例targetType - 目标类型UnsupportedOperationException - 无法定位ApplicationContext实例IllegalArgumentException - 无法转换Copyright © 2022. All rights reserved.