RemoveRecord.java

package org.microspace.replicator.record;

import java.io.Serializable;

import org.microspace.table.column.Accessor;

/**
 * This Record is used when data is replicated.
 * 
 * @author Gaspar Sinai - {@literal gaspar.sinai@microspace.org}
 * @version 2016-06-26
 */
public class RemoveRecord implements RecordData, Serializable {

	private static final long serialVersionUID = 2012062410503000001L;

	String className;
	Object key;

	public RemoveRecord (String className, Object key) {
		this.className = className;
		this.key = key;
	}
	
	public <T> RemoveRecord (Accessor<T> accessor, T data) {
		this.className = data.getClass().getName();
		this.key = accessor.getPrimaryKeyGetSetPair().get(data);
	}


	public String getClassName() {
		return className;
	}

	public Object getKey() {
		return key;
	}
	
}