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

com.vaadin.addon.jpacontainer.provider.EntityEvent Maven / Gradle / Ivy

The newest version!
/*
JPAContainer
Copyright (C) 2009-2011 Oy Vaadin Ltd

This program is available under GNU Affero General Public License (version
3 or later at your option).

See the file licensing.txt distributed with this software for more
information about licensing.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see .
 */
package com.vaadin.addon.jpacontainer.provider;

import com.vaadin.addon.jpacontainer.EntityProvider;
import com.vaadin.addon.jpacontainer.EntityProviderChangeEvent;
import com.vaadin.addon.jpacontainer.MutableEntityProvider;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;

/**
 * Base class for {@link EntityProviderChangeEvent}s.
 *
 * @author Petter Holmström (Vaadin Ltd)
 * @since 1.0
 */
abstract class EntityEvent implements EntityProviderChangeEvent,
		Serializable {

	private static final long serialVersionUID = -3703337782681273703L;
	private Collection entities;
	private MutableEntityProvider entityProvider;

	public EntityEvent(MutableEntityProvider entityProvider,
			T... entities) {
		this.entityProvider = entityProvider;
		if (entities.length == 0) {
			this.entities = Collections.emptyList();
		} else {
			this.entities = Collections.unmodifiableCollection(Arrays.asList(
					entities));
		}
	}

	public Collection getAffectedEntities() {
		return entities;
	}

	public EntityProvider getEntityProvider() {
		return entityProvider;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy