T - The SerializedType class
TODO, this should only really have methods that each class over-rides
it's currently pretty NASTYpublic abstract class TypeTranslator<T extends SerializedType> extends Object
| 构造器和说明 |
|---|
TypeTranslator() |
| 限定符和类型 | 方法和说明 |
|---|---|
T |
fromBoolean(boolean aBoolean) |
T |
fromBytes(byte[] b) |
T |
fromDouble(double aDouble) |
T |
fromHex(String hex) |
T |
fromInteger(int integer) |
T |
fromJSONArray(org.json.JSONArray jsonArray) |
T |
fromJSONObject(org.json.JSONObject jsonObject) |
T |
fromLong(long aLong) |
T |
fromParser(BinaryParser parser) |
abstract T |
fromParser(BinaryParser parser,
Integer hint) |
T |
fromString(String value) |
T |
fromValue(Object object) |
boolean |
toBoolean(T obj) |
byte[] |
toBytes(T obj) |
void |
toBytesSink(T obj,
BytesSink to) |
double |
toDouble(T obj) |
String |
toHex(T obj) |
int |
toInteger(T obj) |
Object |
toJSON(T obj) |
org.json.JSONArray |
toJSONArray(T obj) |
org.json.JSONObject |
toJSONObject(T obj) |
long |
toLong(T obj) |
String |
toString(T obj) |
public boolean toBoolean(T obj)
public long toLong(T obj)
public int toInteger(T obj)
public double toDouble(T obj)
public T fromJSONObject(org.json.JSONObject jsonObject)
public T fromJSONArray(org.json.JSONArray jsonArray)
public T fromBoolean(boolean aBoolean)
public T fromLong(long aLong)
public T fromInteger(int integer)
public T fromDouble(double aDouble)
public abstract T fromParser(BinaryParser parser, Integer hint)
parser - Parser.hint - Using a boxed integer, allowing null for no hintpublic T fromParser(BinaryParser parser)
public T fromBytes(byte[] b)
public org.json.JSONObject toJSONObject(T obj)
public org.json.JSONArray toJSONArray(T obj)
public byte[] toBytes(T obj)
Copyright © 2021. All rights reserved.