package com.simukappu.coherence.writequeue;

import java.io.IOException;
import java.io.Serializable;
import java.util.Map.Entry;

import com.tangosol.io.pof.PofReader;
import com.tangosol.io.pof.PofWriter;
import com.tangosol.io.pof.PortableObject;

public class PortableEntry<K, V> implements Entry<K, V>, Serializable, PortableObject {

	/**
	 * Serial version used in Serializable interface
	 */
	private static final long serialVersionUID = 421283175624112384L;

	private K key;
	private V value;

	public PortableEntry() {
		super();
	}

	public PortableEntry(K key, V value) {
		super();
		this.key = key;
		this.value = value;
	}

	@Override
	public K getKey() {
		return key;
	}

	@Override
	public V getValue() {
		return value;
	}

	@Override
	public V setValue(V value) {
		this.value = value;
		return value;
	}

	@Override
	public void readExternal(PofReader reader) throws IOException {
		key = reader.readObject(0);
		value = reader.readObject(1);
	}

	@Override
	public void writeExternal(PofWriter writer) throws IOException {
		writer.writeObject(0, key);
		writer.writeObject(1, value);
	}

}

@@ -244,16 +244,212 @@
 bject;%0A%0A
+/**%0A * Custom java.util.Map.Entry implementation class supporting POF serializer%0A * %0A * @author Shota Yamazaki%0A *%0A * @param %3CK%3E%0A *            Key class%0A * @param %3CV%3E%0A *            Value class%0A */%0A
 public c
@@ -692,16 +692,50 @@
 value;%0A%0A
+%09/**%0A%09 * Default constructor%0A%09 */%0A
 %09public 
@@ -772,288 +772,785 @@
 %7D%0A%0A%09
-public PortableEntry(K key, V value) %7B%0A%09%09super();%0A%09%09this.key = key;%0A%09%09this.value = value;%0A%09%7D%0A%0A%09@Override%0A%09public K getKey() %7B%0A%09%09return key;%0A%09%7D%0A%0A%09@Override%0A%09public V getValue() %7B%0A%09%09return value;%0A%09%7D%0A%0A%09@Override%0A%09public V setValue(V value) %7B%0A%09%09this.value = value;%0A%09%09return value;%0A%09%7D%0A
+/**%0A%09 * Constructor using fields%0A%09 * %0A%09 * @param key%0A%09 *            Key of the entry%0A%09 * @param value%0A%09 *            Value of the entry%0A%09 */%0A%09public PortableEntry(K key, V value) %7B%0A%09%09super();%0A%09%09this.key = key;%0A%09%09this.value = value;%0A%09%7D%0A%0A%09/*%0A%09 * (non-Javadoc)%0A%09 * %0A%09 * @see java.util.Map.Entry#getKey()%0A%09 */%0A%09@Override%0A%09public K getKey() %7B%0A%09%09return key;%0A%09%7D%0A%0A%09/*%0A%09 * (non-Javadoc)%0A%09 * %0A%09 * @see java.util.Map.Entry#getValue()%0A%09 */%0A%09@Override%0A%09public V getValue() %7B%0A%09%09return value;%0A%09%7D%0A%0A%09/*%0A%09 * (non-Javadoc)%0A%09 * %0A%09 * @see java.util.Map.Entry#setValue(java.lang.Object)%0A%09 */%0A%09@Override%0A%09public V setValue(V value) %7B%0A%09%09this.value = value;%0A%09%09return value;%0A%09%7D%0A%0A%09/*%0A%09 * (non-Javadoc)%0A%09 * %0A%09 * @see com.tangosol.io.pof.PortableObject#readExternal(com.tangosol.io.pof.%0A%09 * PofReader)%0A%09 */
 %0A%09@O
@@ -1688,16 +1688,146 @@
 1);%0A%09%7D%0A%0A
+%09/*%0A%09 * (non-Javadoc)%0A%09 * %0A%09 * @see%0A%09 * com.tangosol.io.pof.PortableObject#writeExternal(com.tangosol.io.pof.%0A%09 * PofWriter)%0A%09 */%0A
 %09@Overri

Add javadoc to PortableEntry