Enum Class JavaTypeToJsonSchemaMapper
java.lang.Object
java.lang.Enum<JavaTypeToJsonSchemaMapper>
com.github.thought2code.mcp.annotated.enums.JavaTypeToJsonSchemaMapper
- All Implemented Interfaces:
Serializable,Comparable<JavaTypeToJsonSchemaMapper>,Constable
This enum is used to map Java types to JSON schema data types.
- Author:
- codeboyzhou
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionJavabooleanis mapped to JSON schema data typeboolean.JavaBooleanis mapped to JSON schema data typeboolean.Javadoubleis mapped to JSON schema data typenumber.JavaDoubleis mapped to JSON schema data typenumber.Javafloatis mapped to JSON schema data typenumber.JavaFloatis mapped to JSON schema data typenumber.Javaintis mapped to JSON schema data typeinteger.JavaIntegeris mapped to JSON schema data typeinteger.Javalongis mapped to JSON schema data typenumber.JavaLongis mapped to JSON schema data typenumber.JavaNumberis mapped to JSON schema data typenumber.JavaObjectis mapped to JSON schema data typeobject.JavaStringis mapped to JSON schema data typestring. -
Method Summary
Modifier and TypeMethodDescriptionReturns the JSON schema data type.static StringgetJsonSchemaType(Class<?> javaType) Returns the JSON schema data type for the specified Java class.static JavaTypeToJsonSchemaMapperReturns the enum constant of this class with the specified name.static JavaTypeToJsonSchemaMapper[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
STRING
JavaStringis mapped to JSON schema data typestring. -
NUMBER
JavaNumberis mapped to JSON schema data typenumber. -
LONG
Javalongis mapped to JSON schema data typenumber. -
LONG_CLASS
JavaLongis mapped to JSON schema data typenumber. -
FLOAT
Javafloatis mapped to JSON schema data typenumber. -
FLOAT_CLASS
JavaFloatis mapped to JSON schema data typenumber. -
DOUBLE
Javadoubleis mapped to JSON schema data typenumber. -
DOUBLE_CLASS
JavaDoubleis mapped to JSON schema data typenumber. -
INT
Javaintis mapped to JSON schema data typeinteger. -
INTEGER
JavaIntegeris mapped to JSON schema data typeinteger. -
BOOLEAN
Javabooleanis mapped to JSON schema data typeboolean. -
BOOLEAN_CLASS
JavaBooleanis mapped to JSON schema data typeboolean. -
OBJECT
JavaObjectis mapped to JSON schema data typeobject.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
getJsonSchemaType
Returns the JSON schema data type.- Returns:
- the JSON schema data type
-
getJsonSchemaType
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
-