package org.ovirt.engine.core.common.queries;

import com.google.gwt.user.client.rpc.SerializationException;
import com.google.gwt.user.client.rpc.SerializationStreamReader;
import com.google.gwt.user.client.rpc.SerializationStreamWriter;

public class ValueObjectMap_CustomFieldSerializer {
	public static void deserialize(SerializationStreamReader streamReader,
			ValueObjectMap instance) throws SerializationException {
		// Handled in instantiate
	}

	public static ValueObjectMap instantiate(
			SerializationStreamReader streamReader)
			throws SerializationException {
		// occur first
		ValueObjectMap r = new ValueObjectMap();
		r.setValuePairs((ValueObjectPair[])streamReader.readObject());

		return r;
	}

	public static void serialize(SerializationStreamWriter streamWriter,
			ValueObjectMap instance) throws SerializationException {
		streamWriter.writeObject(instance.getValuePairs());
	}
}

@@ -285,17 +285,21 @@
 lizer %7B%0A
-%09
+%0A    
 public s
@@ -308,23 +308,33 @@
 tic 
-void deserializ
+ValueObjectMap instantiat
 e(Se
@@ -361,378 +361,594 @@
 der 
-streamReader,%0A%09%09%09ValueObjectMap instance) throws SerializationException %7B%0A%09%09// Handled in instantiate%0A%09%7D%0A%0A%09public static ValueObjectMap instantiate(%0A%09%09%09SerializationStreamReader streamReader)%0A%09%09%09throws SerializationException %7B%0A%09%09// occur first%0A%09%09ValueObjectMap r = new ValueObjectMap();%0A%09%09r.setValuePairs((ValueObjectPair%5B%5D)streamReader.readObject());%0A%0A%09%09return r;%0A%09%7D%0A%0A%09
+reader) throws SerializationException %7B%0A        return new ValueObjectMap();%0A    %7D%0A%0A    public static void serialize(SerializationStreamWriter writer, ValueObjectMap instance) throws SerializationException %7B%0A        // First write the number of pairs:%0A        ValueObjectPair%5B%5D pairs = instance.getValuePairs();%0A        writer.writeInt(pairs.length);%0A%0A        // Then, for each pair, write first the key and then the value:%0A        for (ValueObjectPair pair : pairs) %7B%0A            writer.writeObject(pair.getKey());%0A            writer.writeObject(pair.getValue());%0A        %7D%0A    %7D%0A%0A    
 publ
@@ -954,32 +954,34 @@
 lic static void 
+de
 serialize(Serial
@@ -997,32 +997,23 @@
 ream
-Writ
+Read
 er 
-st
 rea
-mWriter,%0A%09%09%09
+der, 
 Valu
@@ -1069,35 +1069,434 @@
 n %7B%0A
-%09%09
+        // Fir
 st
+ 
 rea
-mWriter.writeObject(
+d the number of pairs:%0A        int length = reader.readInt();%0A%0A        // Then, for each pair, read first the key and then the value:%0A        ValueObjectPair%5B%5D pairs = new ValueObjectPair%5Blength%5D;%0A        for (int i = 0; i %3C length; i++) %7B%0A            pairs%5Bi%5D = new ValueObjectPair();%0A            pairs%5Bi%5D.setKey(reader.readObject());%0A            pairs%5Bi%5D.setValue(reader.readObject());%0A        %7D%0A        
 inst
@@ -1492,33 +1492,33 @@
        instance.
-g
+s
 etValuePairs());
@@ -1518,13 +1518,21 @@
 irs(
-));%0A%09%7D
+pairs);%0A    %7D%0A
 %0A%7D%0A

Fix ValueObjectMap serielizer (#NA)