DataModelRecord.java

package org.microspace.replicator.record;

import java.io.Serializable;
import java.util.Arrays;
import java.util.List;

import org.microspace.table.Entry;

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

	private static final long serialVersionUID = -5912689064757766880L;

	AddRecord[] records;
	
	public DataModelRecord (List<Entry<?>> objects) {
		records = new AddRecord[objects.size()];
		int i=0;
		for (Entry<?> o : objects) {
			records[i++] = new AddRecord (o);
		}
	}
	public AddRecord[] getRecords () {
		return Arrays.copyOf(records, records.length);
	}
	
	public int size () {
		return records.length;
	}
}