Move the internal serviceObjectKey() methods back into DatabaseConfig

They were incorrectly extracted to the interface as default methods
This commit is contained in:
Rob Bygrave
2023-11-03 23:00:29 +13:00
parent 1f9cf1e4b7
commit 314e0a14b8
2 changed files with 10 additions and 10 deletions
@@ -79,15 +79,6 @@ public interface DatabaseBuilder {
*/
void putServiceObject(Object configObject);
default String serviceObjectKey(Object configObject) {
return serviceObjectKey(configObject.getClass());
}
default String serviceObjectKey(Class<?> cls) {
String simpleName = cls.getSimpleName();
return Character.toLowerCase(simpleName.charAt(0)) + simpleName.substring(1);
}
/**
* Set the Jackson JsonFactory to use.
* <p>
@@ -386,7 +386,7 @@ public class DatabaseConfig implements DatabaseBuilder.Settings {
* Note: It is possible that multiple servers are sharing the same state file as
* long as they are in the <b>same</b> JVM/ClassLoader scope. In this case it is
* recommended to use the same uuidNodeId configuration.
*
* <p>
* If you have multiple servers in different JVMs, do <b>not</b> share the state
* files!
*/
@@ -610,6 +610,15 @@ public class DatabaseConfig implements DatabaseBuilder.Settings {
return (P) serviceObject.get(serviceObjectKey(cls));
}
private String serviceObjectKey(Object configObject) {
return serviceObjectKey(configObject.getClass());
}
private String serviceObjectKey(Class<?> cls) {
String simpleName = cls.getSimpleName();
return Character.toLowerCase(simpleName.charAt(0)) + simpleName.substring(1);
}
@Override
public JsonFactory getJsonFactory() {
return jsonFactory;