@@ -0,0 +1,1940 @@
+package utils;%0A%0Aimport java.io.IOException;%0A%0Aimport org.mapdb.Fun.Tuple2;%0A%0Aimport com.fasterxml.jackson.core.JsonGenerator;%0Aimport com.fasterxml.jackson.core.JsonParser;%0Aimport com.fasterxml.jackson.core.JsonProcessingException;%0Aimport com.fasterxml.jackson.databind.DeserializationContext;%0Aimport com.fasterxml.jackson.databind.JsonDeserializer;%0Aimport com.fasterxml.jackson.databind.JsonSerializer;%0Aimport com.fasterxml.jackson.databind.SerializerProvider;%0Aimport com.fasterxml.jackson.databind.deser.std.StdScalarDeserializer;%0Aimport com.fasterxml.jackson.databind.ser.std.StdScalarSerializer;%0Aimport com.google.common.io.BaseEncoding;%0A%0Apublic class JacksonSerializers %7B%0A%09private static final BaseEncoding encoder = BaseEncoding.base64Url();%0A%0A%09public static class Tuple2Serializer extends StdScalarSerializer%3CTuple2%3CString, String%3E%3E %7B%0A%09%09public Tuple2Serializer () %7B%0A%09%09%09super(String.class, true);%0A%09%09%7D%0A%09%09%0A%09%09@Override%0A%09%09public void serialize(Tuple2%3CString, String%3E t2, JsonGenerator jgen,%0A%09%09%09%09SerializerProvider arg2) throws IOException,%0A%09%09%09%09JsonProcessingException %7B%0A%09%09%09// TODO: escaping%0A%09%09%09jgen.writeString(encoder.encode(t2.a.getBytes(%22UTF-8%22)) + %22:%22 + encoder.encode(t2.b.getBytes(%22UTF-8%22)));%0A%09%09%7D%0A%09%7D%0A%09%0A%09public static class Tuple2Deserializer extends StdScalarDeserializer%3CTuple2%3CString, String%3E%3E %7B%0A%09%09public Tuple2Deserializer () %7B%0A%09%09%09super(Tuple2.class);%0A%09%09%7D%0A%09%09%0A%09%09@Override%0A%09%09public Tuple2%3CString, String%3E deserialize(JsonParser jp,%0A%09%09%09%09DeserializationContext arg1) throws IOException,%0A%09%09%09%09JsonProcessingException %7B%09%09%09%0A%09%09%09return deserialize(jp.readValueAs(String.class));%0A%09%09%7D%0A%09%09%0A%09%09public static Tuple2%3CString, String%3E deserialize (String serialized) throws IOException %7B%0A%09%09%09String%5B%5D val = serialized.split(%22:%22);%0A%09%09%09if (val.length != 2) %7B%0A%09%09%09%09throw new IOException(%22Unable to parse value%22);%0A%09%09%09%7D%0A%09%09%09%0A%09%09%09return new Tuple2%3CString, String%3E(new String(encoder.decode(val%5B0%5D), %22UTF-8%22), new String(encoder.decode(val%5B1%5D), %22UTF-8%22));%0A%09%09%7D%0A%09%7D%0A%7D%0A

add serializers for tuple2<string,string> #166.