package jcgp.backend.resources.parameters; import javafx.beans.property.SimpleBooleanProperty; public abstract class BooleanParameter extends Parameter { private SimpleBooleanProperty value; public BooleanParameter(boolean value, String name, boolean monitor, boolean critical) { super(name, monitor, critical); this.value = new SimpleBooleanProperty(value); } /** * Simple BooleanParameter constructor, * * * @param value * @param name */ public BooleanParameter(boolean value, String name) { super(name, false, false); this.value = new SimpleBooleanProperty(value); } public boolean get() { return value.get(); } public void set(boolean newValue) { if (!value.isBound()) { value.set(newValue); } } public abstract void validate(boolean newValue); @Override public SimpleBooleanProperty valueProperty() { return value; } }