001// License: GPL. For details, see LICENSE file.
002package org.openstreetmap.josm.data.preferences;
003
004/**
005 * A property containing a {@code Boolean} value.
006 */
007public class BooleanProperty extends AbstractToStringProperty<Boolean> {
008
009    /**
010     * Constructs a new {@code BooleanProperty}.
011     * @param key The property key
012     * @param defaultValue The default value
013     */
014    public BooleanProperty(String key, boolean defaultValue) {
015        super(key, defaultValue);
016    }
017
018    @Override
019    public Boolean get() {
020        // Removing this implementation breaks binary compatibility
021        return super.get();
022    }
023
024    @Override
025    public boolean put(Boolean value) {
026        // Removing this implementation breaks binary compatibility
027        return super.put(value);
028    }
029
030    @Override
031    protected Boolean fromString(String string) {
032        return Boolean.valueOf(string);
033    }
034
035    @Override
036    protected String toString(Boolean t) {
037        return t.toString();
038    }
039}