All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mindoo.domino.jna.virtualviews.VirtualViewDataChange Maven / Gradle / Ivy

The newest version!
package com.mindoo.domino.jna.virtualviews;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

/**
 * Class to encapsulate changes in a {@link VirtualView} data set by one data provider
 */
public class VirtualViewDataChange {
	private String origin;
	private Set removals;
	private Map additions;
	
	public VirtualViewDataChange(String origin) {
		this.origin = origin;
		this.removals = new HashSet<>();
		this.additions = new HashMap<>();
	}
	
	public String getOrigin() {
		return origin;
	}
	
	public void removeEntry(int noteId) {
		removals.add(noteId);
	}
	
	public void addEntry(int noteId, String unid, Map values) {
		EntryData entry = new EntryData(unid, values);
		additions.put(noteId, entry);
	}
	
	public static class EntryData {
		private String unid;
		private Map values;

		public EntryData(String unid, Map values) {
			this.unid = unid;
			this.values = values;
		}
		
		public String getUnid() {
			return unid;
		}
		
		public Map getValues() {
			return values;
		}
	}
	
	public Set getRemovals() {
		return removals;
	}
	
	public Map getAdditions() {
		return additions;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy