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

import java.io.File;

import de.ivu.elect.business.mandant.entity.Mandant;
import de.ivu.elect.business.wahl.entity.Wahl;

public abstract class AbstractWahlExchangeContext extends AbstractExchangeContext {

  private static final long serialVersionUID = 1L;

  private final Wahl wahl;

  protected AbstractWahlExchangeContext(Wahl wahl) {
    this(wahl, null);
  }

  protected AbstractWahlExchangeContext(Wahl wahl, File postExportTargetDirectory) {
    super(postExportTargetDirectory);

    this.wahl = wahl;
  }

  public boolean hasWahl() {
    return getWahl() != null;
  }

  public Wahl getWahl() {
    return wahl;
  }

  public Mandant getMandant() {
    if (wahl == null) {
      return null;
    }

    return wahl.getMandant();
  }
}
