|
Last change
on this file was 10824, checked in by Don-vip, 10 years ago |
|
see #13309 - Caching and notifying preferences (patch by michael2402) - gsoc-core
|
-
Property svn:eol-style
set to
native
|
|
File size:
990 bytes
|
| Line | |
|---|
| 1 | // License: GPL. For details, see LICENSE file.
|
|---|
| 2 | package org.openstreetmap.josm.data.preferences;
|
|---|
| 3 |
|
|---|
| 4 | /**
|
|---|
| 5 | * A property containing a {@code Boolean} value.
|
|---|
| 6 | */
|
|---|
| 7 | public class BooleanProperty extends AbstractToStringProperty<Boolean> {
|
|---|
| 8 |
|
|---|
| 9 | /**
|
|---|
| 10 | * Constructs a new {@code BooleanProperty}.
|
|---|
| 11 | * @param key The property key
|
|---|
| 12 | * @param defaultValue The default value
|
|---|
| 13 | */
|
|---|
| 14 | public BooleanProperty(String key, boolean defaultValue) {
|
|---|
| 15 | super(key, defaultValue);
|
|---|
| 16 | }
|
|---|
| 17 |
|
|---|
| 18 | @Override
|
|---|
| 19 | public Boolean get() {
|
|---|
| 20 | // Removing this implementation breaks binary compatibility
|
|---|
| 21 | return super.get();
|
|---|
| 22 | }
|
|---|
| 23 |
|
|---|
| 24 | @Override
|
|---|
| 25 | public boolean put(Boolean value) {
|
|---|
| 26 | // Removing this implementation breaks binary compatibility
|
|---|
| 27 | return super.put(value);
|
|---|
| 28 | }
|
|---|
| 29 |
|
|---|
| 30 | @Override
|
|---|
| 31 | protected Boolean fromString(String string) {
|
|---|
| 32 | return Boolean.valueOf(string);
|
|---|
| 33 | }
|
|---|
| 34 |
|
|---|
| 35 | @Override
|
|---|
| 36 | protected String toString(Boolean t) {
|
|---|
| 37 | return t.toString();
|
|---|
| 38 | }
|
|---|
| 39 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.