public final class Conversions extends Object
Functions to perform
common conversions.| Modifier and Type | Method and Description |
|---|---|
static Function<Object,TObject> |
javaToThrift()
Return a function to perform a conversion from a java
Object to a
TObject. |
static <T> Function<T,T> |
none()
Return a function that doesn't perform any conversion.
|
static Function<Object,Object> |
possibleThriftToJava()
Return a function to perform a conversion from a possible
TObject
to a java {#link Object}. |
static Function<TObject,Object> |
thriftToJava()
Return a function to perform a conversion from a
TObject to a
java Object. |
static <T> Function<TObject,T> |
thriftToJavaCasted()
Return a function to perform a casted conversion from
TObject to
a java object of the parameterized type. |
static Function<Long,Timestamp> |
timestampToMicros()
Return a function to perform a conversion from an
Timestamp to a
long value that represents the corresponding unix timestamp with
microsecond precision. |
public static Function<Object,TObject> javaToThrift()
Object to a
TObject.public static <T> Function<T,T> none()
public static Function<Object,Object> possibleThriftToJava()
TObject
to a java {#link Object}.public static Function<TObject,Object> thriftToJava()
TObject to a
java Object.public static <T> Function<TObject,T> thriftToJavaCasted()
TObject to
a java object of the parameterized type.
Compared to the thriftToJava() method, functions returned here
will attempt to cast the object to type T instead of returning a
plain Object.