public interface JsonSerializable
Modifier and Type | Field and Description |
---|---|
static String |
CLASS_NAME_FIELD
This must match the java field for the class name.
|
Modifier and Type | Method and Description |
---|---|
static JsonSerializable |
fromJson(String json) |
static <T extends JsonSerializable> |
fromJson(String json,
T[] types) |
default String |
getClassName() |
default void |
setClassName(String className) |
default String |
toJson() |
static final String CLASS_NAME_FIELD
default String getClassName()
default void setClassName(String className)
className
- the name of the classdefault String toJson() throws com.fasterxml.jackson.core.JsonProcessingException
com.fasterxml.jackson.core.JsonProcessingException
static JsonSerializable fromJson(String json) throws IOException, ClassNotFoundException
json
- the json string representationIOException
ClassNotFoundException
static <T extends JsonSerializable> T fromJson(String json, T[] types) throws IOException, ClassNotFoundException
T
- the type to returnjson
- the json string representationtypes
- the array types to cast the resulting objectIOException
ClassNotFoundException
Copyright © 2023. All Rights Reserved.