
package de.ivu.elect.exchange.csv.converter;

import org.jsefa.common.converter.SimpleTypeConverter;
import org.jsefa.common.converter.SimpleTypeConverterConfiguration;

import de.ivu.elect.business.exchange.boundary.ExchangeStringConverter;


import static de.ivu.elect.business.exchange.boundary.ExchangeStringConverter.createExchangeStringConverterWithoutValueDecorators;

public abstract class AbstractElectCsvStringConverter implements SimpleTypeConverter {

  private final ExchangeStringConverter exchangeStringConverter;

  protected AbstractElectCsvStringConverter(SimpleTypeConverterConfiguration configuration) {
    super();

    exchangeStringConverter = createExchangeStringConverterWithoutValueDecorators();
  }

  @Override
  public String toString(Object value) {
    return exchangeStringConverter.toString(value);
  }

  @Override
  public Object fromString(String value) {
    return exchangeStringConverter.fromString(value);
  }
}
