Package com.cloudbees.workflow.util
Class JSONReadWrite
- java.lang.Object
-
- com.cloudbees.workflow.util.JSONReadWrite
-
public class JSONReadWrite extends Object
- Author:
- tom.fennelly@gmail.com
-
-
Field Summary
Fields Modifier and Type Field Description static com.fasterxml.jackson.databind.ObjectMapper
jsonMapper
-
Constructor Summary
Constructors Constructor Description JSONReadWrite()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
fromBytes(byte[] bytes, Charset encoding, Class<T> to)
<T> T
fromString(String string, Class<T> to)
String
toString(Object object)
byte[]
toUTF8Bytes(Object object)
-
-
-
Method Detail
-
fromString
public <T> T fromString(String string, Class<T> to) throws IOException
- Throws:
IOException
-
fromBytes
public <T> T fromBytes(byte[] bytes, Charset encoding, Class<T> to) throws IOException
- Throws:
IOException
-
toString
public String toString(Object object) throws IOException
- Throws:
IOException
-
toUTF8Bytes
public byte[] toUTF8Bytes(Object object) throws IOException
- Throws:
IOException
-
-