
package de.ivu.elect.business.wertelisten.control;

import javax.enterprise.event.Event;
import javax.inject.Inject;
import java.io.Serializable;

import de.ivu.elect.business.wahl.entity.Wahl;
import de.ivu.elect.business.wertelisten.entity.WertelistenArt;

public class WertelistenUpdatedEvent implements Serializable {

  private static final long serialVersionUID = 1L;

  private String oldValue;

  private String newValue;

  private WertelistenArt wertelistenArt;

  private Wahl wahl;

  @Inject
  transient Event<WertelistenUpdatedEvent> event;

  public void sendChangeEvent(String oldValue, String newValue, WertelistenArt wertelistenArt, Wahl wahl) {
    event.fire(new WertelistenUpdatedEvent(oldValue, newValue, wertelistenArt, wahl));
  }

  public WertelistenUpdatedEvent() {
    // default Konstruktor
  }

  public WertelistenUpdatedEvent(String oldValue, String newValue, WertelistenArt wertelistenArt, Wahl wahl) {
    this.oldValue = oldValue;
    this.newValue = newValue;
    this.wertelistenArt = wertelistenArt;
    this.wahl = wahl;
  }

  public String getOldValue() {
    return oldValue;
  }

  public String getNewValue() {
    return newValue;
  }

  public WertelistenArt getWertelistenArt() {
    return wertelistenArt;
  }

  public Wahl getWahl() {
    return wahl;
  }
}