Project

General

Profile

Download (1006 Bytes) Statistics
| Branch: | Tag: | Revision:
1 191308d3 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
/**
12
 * @author a.kohlbecker
13
 * @since Mar 22, 2017
14
 *
15
 */
16
public abstract class AbstractEntityEvent {
17
18
19
    private EntityEventType eventType;
20
21
    public AbstractEntityEvent(EntityEventType eventType) {
22
        this.eventType = eventType;
23
        if(eventType == null){
24
            throw new NullPointerException();
25
        }
26
    }
27
28
    public EntityEventType getEventType() {
29
        return eventType;
30
    }
31
32
    public boolean isAddEvent() {
33
        return eventType.equals(EntityEventType.ADD);
34
    }
35
    public boolean isEditEvent() {
36
        return eventType.equals(EntityEventType.EDIT);
37
    }
38
    public boolean isRemoveEvent() {
39
        return eventType.equals(EntityEventType.REMOVE);
40
    }
41
42
}