
package de.ivu.elect.business.gebietsbaum.boundary;

import java.io.Serializable;

import de.ivu.elect.business.gebietsbaum.entity.Gebiet;
import de.ivu.elect.jee.presentation.dynamicform.AbstractBooleanProperty;
import de.ivu.elect.jee.presentation.dynamicform.Property;

public interface SearchParametersMitGebiet extends Serializable {

  Gebiet getGebiet();

  void setGebiet(Gebiet gebiet);

  boolean isIncludeUntergebiete();

  void setIncludeUntergebiete(boolean includeUntergebiete);

  Property getIncludeUntergebieteProperty();

  public static final class IncludeUntergebieteProperty extends AbstractBooleanProperty {

    private final SearchParametersMitGebiet searchParameters;

    public IncludeUntergebieteProperty(SearchParametersMitGebiet searchParameters) {
      super();

      this.searchParameters = searchParameters;
    }

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

    @Override
    public String getDefaultLabel() {
      return getMessage("entity.mit.gebiet.search.parameter.include.untergebiete.label");
    }

    @Override
    public Boolean getValue() {
      return searchParameters.isIncludeUntergebiete();
    }

    @Override
    public void setValue(Boolean value) {
      searchParameters.setIncludeUntergebiete(value);
    }
  }
}
