
package de.ivu.elect.jee.presentation.dynamicform;

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

public class LambdaDateBetweenProperty extends AbstractTemporalBetweenProperty {

  private static final AbstractDateProperty TEMPLATE = new AbstractDateProperty() {

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

    @Override
    public String getDefaultLabel() {
      return null;
    }

    @Override
    public void setValue(Date value) {
    }

    @Override
    public Date getValue() {
      return null;
    }
  };

  public LambdaDateBetweenProperty(String defaultLabel, AbstractDateProperty from, AbstractDateProperty to) {
    this(defaultLabel, from.isRequired(), from::setValue, from::getValue, to.isRequired(), to::setValue, to::getValue);
  }

  public LambdaDateBetweenProperty(String defaultLabel, boolean valueFromRequired, Consumer<Date> setterFrom, Supplier<Date> getterFrom, boolean valueToRequired, Consumer<Date> setterTo,
      Supplier<Date> getterTo) {
    super(PropertyType.INPUT_CALENDAR_BETWEEN, TEMPLATE, defaultLabel, valueFromRequired, setterFrom, getterFrom, valueToRequired, setterTo, getterTo);
  }
}
