
package de.ivu.elect.presentation.dokumente;

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

import de.ivu.elect.business.dokumente.entity.DokumentVorlage;

public class DokumentVorlageLambdaProperty extends DokumentVorlageProperty {

  private final Supplier<DokumentVorlage> getter;

  private final Consumer<DokumentVorlage> setter;

  public DokumentVorlageLambdaProperty(List<DokumentVorlage> values, Supplier<DokumentVorlage> getter, Consumer<DokumentVorlage> setter) {
    super(values);

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

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

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

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