Package alluxio.util
Interface JsonSerializable
-
public interface JsonSerializable
This represents stress test objects that can be ser/de to/from json.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CLASS_NAME_FIELD
This must match the java field for the class name.
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Modifier and Type Method Description static JsonSerializable
fromJson(java.lang.String json)
static <T extends JsonSerializable>
TfromJson(java.lang.String json, T[] types)
default java.lang.String
getClassName()
default void
setClassName(java.lang.String className)
default java.lang.String
toJson()
-
-
-
Field Detail
-
CLASS_NAME_FIELD
static final java.lang.String CLASS_NAME_FIELD
This must match the java field for the class name.- See Also:
- Constant Field Values
-
-
Method Detail
-
getClassName
default java.lang.String getClassName()
- Returns:
- the name of the class
-
setClassName
default void setClassName(java.lang.String className)
- Parameters:
className
- the name of the class
-
toJson
default java.lang.String toJson() throws com.fasterxml.jackson.core.JsonProcessingException
- Returns:
- the json string representation
- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
fromJson
static JsonSerializable fromJson(java.lang.String json) throws java.io.IOException, java.lang.ClassNotFoundException
- Parameters:
json
- the json string representation- Returns:
- the parsed object
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
-
fromJson
static <T extends JsonSerializable> T fromJson(java.lang.String json, T[] types) throws java.io.IOException, java.lang.ClassNotFoundException
- Type Parameters:
T
- the type to return- Parameters:
json
- the json string representationtypes
- the array types to cast the resulting object- Returns:
- the parsed object
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
-
-