#2342 - Rename Database.getName() to Database.name() with deprecation

This commit is contained in:
Rob Bygrave
2021-09-02 22:41:51 +12:00
parent 6311d0bf4e
commit f770b66f42
15 changed files with 24 additions and 16 deletions
@@ -136,7 +136,15 @@ public interface Database {
* Return the name. This is used with {@link DB#byName(String)} to get a
* Database that was registered with the DB singleton.
*/
String getName();
String name();
/**
* Deprecated migrate to name().
*/
@Deprecated
default String getName() {
return name();
}
/**
* Return the ExpressionFactory for this database.
@@ -115,7 +115,7 @@ final class DbContext {
* Register a server so we can get it by its name.
*/
void register(Database server, boolean isDefault) {
registerWithName(server.getName(), server, isDefault);
registerWithName(server.name(), server, isDefault);
}
private void registerWithName(String name, Database server, boolean isDefault) {
@@ -20,7 +20,7 @@ public abstract class SingleBeanLoader implements BeanLoader {
@Override
public String getName() {
return database.getName();
return database.name();
}
@Override