
package de.ivu.elect.exchange.konfiguration;

import de.ivu.elect.business.konfiguration.entity.Konfiguration;

public abstract class AbstractDefaultKonfigurationMapper<T extends ExchangeKonfigurationDTO>
    implements
      KonfigurationMapper {

  public static final String FILE_FORMAT_NAME = "file.format.konfiguration.default";

  protected abstract T createEntity();

  protected T mappeEntity(Konfiguration from) {
    T to = createEntity();
    to.setKey(from.getKey());
    to.setWert(from.getWert());

    return to;
  }

  protected Konfiguration mappeEntity(T from) {
    Konfiguration to = new Konfiguration();
    to.setKey(from.getKey());
    to.setWert(from.getWert());

    return to;
  }
}
