1 package net.pterodactylus.sone;
3 import java.util.concurrent.atomic.AtomicReference;
5 import net.pterodactylus.util.config.ConfigurationException;
6 import net.pterodactylus.util.config.Value;
9 * Simple {@link Value} implementation.
11 * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
13 public class TestValue<T> implements Value<T> {
15 private final AtomicReference<T> value = new AtomicReference<T>();
17 public TestValue(T originalValue) {
18 value.set(originalValue);
22 public T getValue() throws ConfigurationException {
27 public T getValue(T defaultValue) {
28 final T realValue = value.get();
29 return (realValue != null) ? realValue : defaultValue;
33 public void setValue(T newValue) throws ConfigurationException {