Package one.nio.serial
Class Json
- java.lang.Object
-
- one.nio.serial.Json
-
public class Json extends Object
-
-
Constructor Summary
Constructors Constructor Description Json()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidappendBinary(StringBuilder builder, byte[] array)static voidappendChar(StringBuilder builder, char c)static voidappendChars(StringBuilder builder, char[] obj)static voidappendObject(StringBuilder builder, Object obj)static voidappendString(StringBuilder builder, String s)static ObjectfromJson(String s)static <T> TfromJson(String s, Class<T> cls)static ObjectfromJson(String s, Type type)static StringtoJson(Object obj)
-
-
-
Method Detail
-
appendChar
public static void appendChar(StringBuilder builder, char c)
-
appendChars
public static void appendChars(StringBuilder builder, char[] obj)
-
appendString
public static void appendString(StringBuilder builder, String s)
-
appendBinary
public static void appendBinary(StringBuilder builder, byte[] array)
-
appendObject
public static void appendObject(StringBuilder builder, Object obj) throws IOException
- Throws:
IOException
-
toJson
public static String toJson(Object obj) throws IOException
- Throws:
IOException
-
fromJson
public static Object fromJson(String s) throws IOException, ClassNotFoundException
- Throws:
IOExceptionClassNotFoundException
-
fromJson
public static <T> T fromJson(String s, Class<T> cls) throws IOException, ClassNotFoundException
- Throws:
IOExceptionClassNotFoundException
-
fromJson
public static Object fromJson(String s, Type type) throws IOException, ClassNotFoundException
- Throws:
IOExceptionClassNotFoundException
-
-