package hprose.example.io;

import static hprose.io.HproseTags.TagClosebrace;
import static hprose.io.HproseTags.TagMap;
import static hprose.io.HproseTags.TagOpenbrace;
import hprose.io.serialize.ReferenceSerializer;
import hprose.io.serialize.Writer;
import java.io.IOException;
import java.io.OutputStream;
import org.apache.commons.lang3.tuple.ImmutablePair;

public class ImmutablePairSerializer<K, V> extends ReferenceSerializer<ImmutablePair<K, V>> {

    public final static ImmutablePairSerializer instance = new ImmutablePairSerializer();

    @Override
    public void serialize(Writer writer, ImmutablePair<K, V> pair) throws IOException {
        super.serialize(writer, pair);
        OutputStream stream = writer.stream;
        stream.write(TagMap);
        stream.write('1');
        stream.write(TagOpenbrace);
        writer.serialize(pair.left);
        writer.serialize(pair.right);
        stream.write(TagClosebrace);
    }
}

@@ -393,22 +393,16 @@
 rializer
-%3CK, V%3E
  extends
@@ -435,22 +435,16 @@
 ablePair
-%3CK, V%3E
 %3E %7B%0A%0A   
@@ -603,14 +603,8 @@
 Pair
-%3CK, V%3E
  pai

Update example