aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/config/ConfigSuffix.java
diff options
context:
space:
mode:
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);
}
}