1 |
838412f6
|
Andreas Kohlbecker
|
/**
|
2 |
|
|
* Copyright (C) 2017 EDIT
|
3 |
|
|
* European Distributed Institute of Taxonomy
|
4 |
|
|
* http://www.e-taxonomy.eu
|
5 |
|
|
*
|
6 |
|
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7 |
|
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8 |
|
|
*/
|
9 |
|
|
package eu.etaxonomy.cdm.vaadin.event;
|
10 |
|
|
|
11 |
0844524a
|
Andreas Kohlbecker
|
import java.util.UUID;
|
12 |
|
|
|
13 |
e8674a36
|
Andreas Kohlbecker
|
import eu.etaxonomy.vaadin.mvp.AbstractView;
|
14 |
|
|
|
15 |
838412f6
|
Andreas Kohlbecker
|
/**
|
16 |
|
|
* @author a.kohlbecker
|
17 |
|
|
* @since May 10, 2017
|
18 |
|
|
*
|
19 |
|
|
*/
|
20 |
|
|
public abstract class AbstractEntityEvent<T extends Enum> {
|
21 |
|
|
|
22 |
0844524a
|
Andreas Kohlbecker
|
private UUID entityUuid = null;
|
23 |
838412f6
|
Andreas Kohlbecker
|
|
24 |
|
|
protected T type;
|
25 |
|
|
|
26 |
e8674a36
|
Andreas Kohlbecker
|
private AbstractView sourceView = null;
|
27 |
|
|
|
28 |
0844524a
|
Andreas Kohlbecker
|
public AbstractEntityEvent(T type, UUID entityUuid, AbstractView sourceView) {
|
29 |
|
|
this.entityUuid = entityUuid;
|
30 |
838412f6
|
Andreas Kohlbecker
|
this.type = type;
|
31 |
e8674a36
|
Andreas Kohlbecker
|
this.sourceView = sourceView;
|
32 |
838412f6
|
Andreas Kohlbecker
|
if(type == null){
|
33 |
|
|
throw new NullPointerException();
|
34 |
|
|
}
|
35 |
|
|
}
|
36 |
|
|
|
37 |
|
|
/**
|
38 |
|
|
* @return the entityId
|
39 |
|
|
*/
|
40 |
0844524a
|
Andreas Kohlbecker
|
public UUID getEntityUuid() {
|
41 |
|
|
return entityUuid;
|
42 |
838412f6
|
Andreas Kohlbecker
|
}
|
43 |
|
|
|
44 |
9a1b0c01
|
Andreas Kohlbecker
|
public T getType() {
|
45 |
|
|
return type;
|
46 |
|
|
}
|
47 |
|
|
|
48 |
e8674a36
|
Andreas Kohlbecker
|
/**
|
49 |
|
|
* @return the sourceView
|
50 |
|
|
*/
|
51 |
|
|
public AbstractView getSourceView() {
|
52 |
|
|
return sourceView;
|
53 |
|
|
}
|
54 |
|
|
|
55 |
838412f6
|
Andreas Kohlbecker
|
}
|