public class Marshallers extends Object
Marshaller
s and related utilities.Modifier and Type | Method and Description |
---|---|
static Marshaller<ByteBuffer> |
getByteBufferMarshaller()
Returns a
Marshaller for ByteBuffer . |
static <T> Marshaller<T> |
getGenericJsonMarshaller(Class<T> type)
Returns a
Marshaller for the given type. |
static Marshaller<Integer> |
getIntegerMarshaller()
Returns a
Marshaller for Integers s that uses a more efficient representation
than getSerializationMarshaller() . |
static <K,V> Marshaller<KeyValue<K,V>> |
getKeyValueMarshaller(Marshaller<K> keyMarshaller,
Marshaller<V> valueMarshaller)
Returns a
Marshaller for key-value pairs based on keyMarshaller and
valueMarshaller . |
static <K,V> Marshaller<KeyValue<K,? extends Iterable<V>>> |
getKeyValuesMarshaller(Marshaller<K> keyMarshaller,
Marshaller<V> valueMarshaller)
Returns a
Marshaller for key-values pairs based on keyMarshaller and
valueMarshaller . |
static Marshaller<Long> |
getLongMarshaller()
Returns a
Marshaller for Long s that uses a more efficient representation than
getSerializationMarshaller() . |
static <T extends Serializable> |
getSerializationMarshaller()
Returns a
Marshaller that uses Java Serialization. |
static Marshaller<String> |
getStringMarshaller()
Returns a
Marshaller for String s. |
static Marshaller<Void> |
getVoidMarshaller()
Returns a
Marshaller for Void . |
public static <T extends Serializable> Marshaller<T> getSerializationMarshaller()
Marshaller
that uses Java Serialization. Works for any type that implements
Serializable
, but is not space-efficient for boxed primitives like Long
or
Double
.public static Marshaller<String> getStringMarshaller()
Marshaller
for String
s. They will be encoded in UTF-8.public static Marshaller<Long> getLongMarshaller()
Marshaller
for Long
s that uses a more efficient representation than
getSerializationMarshaller()
.public static Marshaller<Integer> getIntegerMarshaller()
Marshaller
for Integers
s that uses a more efficient representation
than getSerializationMarshaller()
.public static Marshaller<Void> getVoidMarshaller()
Marshaller
for Void
.public static Marshaller<ByteBuffer> getByteBufferMarshaller()
Marshaller
for ByteBuffer
.public static <K,V> Marshaller<KeyValue<K,V>> getKeyValueMarshaller(Marshaller<K> keyMarshaller, Marshaller<V> valueMarshaller)
Marshaller
for key-value pairs based on keyMarshaller
and
valueMarshaller
.public static <K,V> Marshaller<KeyValue<K,? extends Iterable<V>>> getKeyValuesMarshaller(Marshaller<K> keyMarshaller, Marshaller<V> valueMarshaller)
Marshaller
for key-values pairs based on keyMarshaller
and
valueMarshaller
.public static <T> Marshaller<T> getGenericJsonMarshaller(Class<T> type)
Marshaller
for the given type. Uses jackson to serialize/deserialize.Copyright © 2015 Google. All rights reserved.