Refactor preferences with interface

This commit is contained in:
SiboVG 2024-07-21 23:13:25 +02:00
parent c86c04bd42
commit 9b5c865823
2 changed files with 20 additions and 1 deletions

View File

@ -35,7 +35,7 @@ import info.openrocket.core.util.MathUtil;
import info.openrocket.core.util.StateChangeListener;
import info.openrocket.core.util.UniqueID;
public abstract class ORPreferences implements ChangeSource {
public abstract class ORPreferences implements ChangeSource, Preferences {
private static final String SPLIT_CHARACTER = "|";
/*

View File

@ -0,0 +1,19 @@
package info.openrocket.core.preferences;
public interface Preferences {
boolean getBoolean(String key, boolean defaultValue);
void putBoolean(String key, boolean value);
int getInt(String key, int defaultValue);
void putInt(String key, int value);
double getDouble(String key, double defaultValue);
void putDouble(String key, double value);
String getString(String key, String defaultValue);
void putString(String key, String value);
}