import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
private final T defaultValue;
/** The current value. */
- private T value;
+ private volatile T value;
/** The option watcher. */
private final List<OptionWatcher<T>> optionWatchers = new ArrayList<OptionWatcher<T>>();
}
/** Holds all {@link Boolean} {@link Option}s. */
- private final Map<String, Option<Boolean>> booleanOptions = new HashMap<String, Option<Boolean>>();
+ private final Map<String, Option<Boolean>> booleanOptions = Collections.synchronizedMap(new HashMap<String, Option<Boolean>>());
/** Holds all {@link Integer} {@link Option}s. */
- private final Map<String, Option<Integer>> integerOptions = new HashMap<String, Option<Integer>>();
+ private final Map<String, Option<Integer>> integerOptions = Collections.synchronizedMap(new HashMap<String, Option<Integer>>());
/**
* Adds a boolean option.