
package de.ivu.elect.presentation.person.form;

import static java.util.Arrays.asList;

import java.util.List;
import java.util.function.Consumer;
import java.util.function.Supplier;

import de.ivu.elect.business.person.boundary.KontoverbindungFilterKriterium;
import de.ivu.elect.business.person.entity.KontoverbindungConstants;
import de.ivu.elect.jee.presentation.dynamicform.AbstractEnumProperty;

public class KontoverbindungFilterKriteriumProperty extends AbstractEnumProperty<KontoverbindungFilterKriterium> {

  private final Supplier<KontoverbindungFilterKriterium> getter;

  private final Consumer<KontoverbindungFilterKriterium> setter;

  public KontoverbindungFilterKriteriumProperty(Supplier<KontoverbindungFilterKriterium> getter, Consumer<KontoverbindungFilterKriterium> setter) {
    super();

    this.getter = getter;
    this.setter = setter;
  }

  @Override
  public boolean getDefaultRequired() {
    return false;
  }

  @Override
  public KontoverbindungFilterKriterium getValue() {
    return getter.get();
  }

  @Override
  public void setValue(KontoverbindungFilterKriterium value) {
    setter.accept(value);
  }

  @Override
  public List<KontoverbindungFilterKriterium> getValues() {
    return asList(KontoverbindungFilterKriterium.values());
  }

  @Override
  protected Class<KontoverbindungFilterKriterium> getEnumClass() {
    return KontoverbindungFilterKriterium.class;
  }

  @Override
  public String getDefaultLabel() {
    return getMessage(KontoverbindungConstants.MESSAGE_KEY_ENTITY_EINZAHL);
  }
}
