package de.retest.recheck.ui.review;

import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

import de.retest.recheck.ui.descriptors.Element;
import de.retest.recheck.ui.descriptors.IdentifyingAttributes;

public class ActionChangeSet {

	private final String description;
	private final String goldenMasterPath;

	public ActionChangeSet() {
		this( null, null );
	}

	public ActionChangeSet( final String description, final String goldenMasterPath ) {
		this.description = description;
		this.goldenMasterPath = goldenMasterPath;
	}

	private final AttributeChanges identAttributeChanges = new AttributeChanges();

	public AttributeChanges getIdentAttributeChanges() {
		return identAttributeChanges;
	}

	private final AttributeChanges attributeChanges = new AttributeChanges();

	public AttributeChanges getAttributesChanges() {
		return attributeChanges;
	}

	private final Set<Element> insertChanges = new HashSet<>();

	public boolean containsInsertChange( final Element element ) {
		return insertChanges.contains( element );
	}

	public void addInsertChange( final Element element ) {
		insertChanges.add( element );
	}

	public void removeInsertChange( final Element element ) {
		insertChanges.remove( element );
	}

	public Set<Element> getInsertedChanges() {
		return Collections.unmodifiableSet( insertChanges );
	}

	private final Set<IdentifyingAttributes> deletedChanges = new HashSet<>();

	public boolean containsDeletedChange( final IdentifyingAttributes identifyingAttributes ) {
		return deletedChanges.contains( identifyingAttributes );
	}

	public void addDeletedChange( final IdentifyingAttributes identifyingAttributes ) {
		deletedChanges.add( identifyingAttributes );
	}

	public void removeDeletedChange( final IdentifyingAttributes identifyingAttributes ) {
		deletedChanges.remove( identifyingAttributes );
	}

	public Set<IdentifyingAttributes> getDeletedChanges() {
		return Collections.unmodifiableSet( deletedChanges );
	}

	public boolean isEmpty() {
		return identAttributeChanges.isEmpty() && attributeChanges.isEmpty() && insertChanges.isEmpty()
				&& deletedChanges.isEmpty();
	}

	private int size() {
		return identAttributeChanges.size() + attributeChanges.size() + insertChanges
				.size() + deletedChanges.size();
	}

	@Override
	public String toString() {
		return "ActionChangeSet [" + size() + " changes]";
	}

	public String getDescription() {
		return description;
	}

	public String getGoldenMasterPath() {
		return goldenMasterPath;
	}
}

@@ -31,16 +31,41 @@
 eview;%0A%0A
+import java.util.Arrays;%0A
 import j
@@ -112,16 +112,39 @@
 ashSet;%0A
+import java.util.List;%0A
 import j
@@ -920,32 +920,161 @@
 uteChanges;%0A%09%7D%0A%0A
+%09public List%3CAttributeChanges%3E getAllAttributeChanges() %7B%0A%09%09return Arrays.asList( identAttributeChanges, attributeChanges );%0A%09%7D%0A%0A
 %09private final S

Create getAllAttributeChanges method