add jukebox feature
This commit is contained in:
@@ -42,12 +42,13 @@ public class SystemPropertyManager {
|
||||
/**
|
||||
* Gets the.
|
||||
*
|
||||
* @param key the key
|
||||
* @param key the key
|
||||
* @param defaultValue the default value
|
||||
* @return the string
|
||||
*/
|
||||
public String get(String key, String defaultValue) {
|
||||
return systemPropertyRepository.findById(key).orElse(new SystemProperty(key, defaultValue)).getValue();
|
||||
return systemPropertyRepository.findById(key).orElse(new SystemProperty(key, defaultValue))
|
||||
.getValue();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -63,7 +64,7 @@ public class SystemPropertyManager {
|
||||
/**
|
||||
* Gets the boolean.
|
||||
*
|
||||
* @param key the key
|
||||
* @param key the key
|
||||
* @param defaultValue the default value
|
||||
* @return the boolean
|
||||
*/
|
||||
@@ -84,7 +85,7 @@ public class SystemPropertyManager {
|
||||
/**
|
||||
* Gets the integer.
|
||||
*
|
||||
* @param key the key
|
||||
* @param key the key
|
||||
* @param defaultValue the default value
|
||||
* @return the integer
|
||||
*/
|
||||
@@ -105,7 +106,7 @@ public class SystemPropertyManager {
|
||||
/**
|
||||
* Gets the long.
|
||||
*
|
||||
* @param key the key
|
||||
* @param key the key
|
||||
* @param defaultValue the default value
|
||||
* @return the long
|
||||
*/
|
||||
@@ -116,7 +117,7 @@ public class SystemPropertyManager {
|
||||
/**
|
||||
* Adds the.
|
||||
*
|
||||
* @param key the key
|
||||
* @param key the key
|
||||
* @param value the value
|
||||
*/
|
||||
public void add(String key, String value) {
|
||||
@@ -128,7 +129,7 @@ public class SystemPropertyManager {
|
||||
/**
|
||||
* Update.
|
||||
*
|
||||
* @param key the key
|
||||
* @param key the key
|
||||
* @param value the value
|
||||
*/
|
||||
public void update(String key, String value) {
|
||||
@@ -139,4 +140,12 @@ public class SystemPropertyManager {
|
||||
systemPropertyRepository.save(systemProperty);
|
||||
}
|
||||
|
||||
public void set(String key, String value) {
|
||||
if (systemPropertyRepository.existsById(key)) {
|
||||
update(key, value);
|
||||
} else {
|
||||
add(key, value);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user