Enum Class JavaTypeToJsonSchemaMapper

java.lang.Object
java.lang.Enum<JavaTypeToJsonSchemaMapper>
com.github.thought2code.mcp.annotated.enums.JavaTypeToJsonSchemaMapper
All Implemented Interfaces:
Serializable, Comparable<JavaTypeToJsonSchemaMapper>, Constable

public enum JavaTypeToJsonSchemaMapper extends Enum<JavaTypeToJsonSchemaMapper>
This enum is used to map Java types to JSON schema data types.
Author:
codeboyzhou
  • Enum Constant Details

  • Method Details

    • values

      public static JavaTypeToJsonSchemaMapper[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static JavaTypeToJsonSchemaMapper valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getJsonSchemaType

      public String getJsonSchemaType()
      Returns the JSON schema data type.
      Returns:
      the JSON schema data type
    • getJsonSchemaType

      public static String getJsonSchemaType(Class<?> javaType)
      Returns the JSON schema data type for the specified Java class. If the Java class is not supported or mapped to a JSON schema data type, "string" will be returned.
      Parameters:
      javaType - the Java class
      Returns:
      the JSON schema data type