类 TypeConverter

java.lang.Object
com.github.codeboyzhou.mcp.declarative.util.TypeConverter

public final class TypeConverter extends Object
Helper class for Java and JSON schema type conversion.
作者:
codeboyzhou
  • 方法详细资料

    • convert

      public static Object convert(@Nullable @Nullable Object value, Class<?> targetType)
      Converts the given value to the specified target type. If the value is null, returns the default value for the target type.
      参数:
      value - the value to convert
      targetType - the target type to convert to
      返回:
      the converted value