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

import java.util.Locale;
import java.util.Map;
import java.util.TimeZone;
import java.util.concurrent.ConcurrentHashMap;

public abstract class AbstractContextMitCustomParameter implements ContextMitCustomParameter {

  protected static final Locale SYSTEM_LOCALE = Locale.getDefault();

  protected static final TimeZone SYSTEM_TIME_ZONE = TimeZone.getDefault();

  private final Locale locale;

  private final TimeZone timeZone;

  private final Map<String, Object> contextParameters;

  protected AbstractContextMitCustomParameter() {
    this(SYSTEM_LOCALE, SYSTEM_TIME_ZONE); // ELECT-12647, Locale/TimeZone der Anwendung...
  }

  protected AbstractContextMitCustomParameter(Locale locale, TimeZone timeZone) {
    super();

    this.locale = locale;
    this.timeZone = timeZone;

    this.contextParameters = new ConcurrentHashMap<>();
  }

  public Locale getLocale() {
    return locale;
  }

  public TimeZone getTimeZone() {
    return timeZone;
  }

  @Override
  public Map<String, Object> getContextParameters() {
    return contextParameters;
  }
}
