Class TypeConverter

java.lang.Object
com.github.thought2code.mcp.annotated.util.TypeConverter

public final class TypeConverter extends Object
Helper class for Java and JSON schema type conversion.
Author:
codeboyzhou
  • Method Details

    • 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.
      Parameters:
      value - the value to convert
      targetType - the target type to convert to
      Returns:
      the converted value