aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/config/ConfigSuffix.java
diff options
context:
space:
mode:
authorAnton Tananaev <atananaev@lyft.com>2020-12-28 14:26:47 -0800
committerAnton Tananaev <atananaev@lyft.com>2020-12-28 14:26:47 -0800
commitea0e6285be71112c5049d4712a2a31c8348dc9cc (patch)
tree46986824f54d07e84606802d93476387a912cc45 /src/main/java/org/traccar/config/ConfigSuffix.java
parent3cc85b094e571f7cf655b5b4d678a7ba718d323e (diff)
downloadtrackermap-server-ea0e6285be71112c5049d4712a2a31c8348dc9cc.tar.gz
trackermap-server-ea0e6285be71112c5049d4712a2a31c8348dc9cc.tar.bz2
trackermap-server-ea0e6285be71112c5049d4712a2a31c8348dc9cc.zip
Refactor config keys
Diffstat (limited to 'src/main/java/org/traccar/config/ConfigSuffix.java')
-rw-r--r--src/main/java/org/traccar/config/ConfigSuffix.java22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/main/java/org/traccar/config/ConfigSuffix.java b/src/main/java/org/traccar/config/ConfigSuffix.java
index 11218ddad..ede4c107d 100644
--- a/src/main/java/org/traccar/config/ConfigSuffix.java
+++ b/src/main/java/org/traccar/config/ConfigSuffix.java
@@ -15,14 +15,26 @@
*/
package org.traccar.config;
-public class ConfigSuffix extends ConfigKey {
+import java.util.List;
- ConfigSuffix(String key, Class<?> clazz) {
- super(key, clazz);
+public class ConfigSuffix<T> {
+
+ private final String keySuffix;
+ private final List<KeyType> types;
+ private final T defaultValue;
+
+ ConfigSuffix(String keySuffix, List<KeyType> types) {
+ this(keySuffix, types, null);
+ }
+
+ ConfigSuffix(String keySuffix, List<KeyType> types, T defaultValue) {
+ this.keySuffix = keySuffix;
+ this.types = types;
+ this.defaultValue = defaultValue;
}
- public ConfigKey withPrefix(String prefix) {
- return new ConfigKey(prefix + getKey(), getValueClass());
+ public ConfigKey<T> withPrefix(String prefix) {
+ return new ConfigKey<>(prefix + keySuffix, types, defaultValue);
}
}