Skip to content

Commit

Permalink
feat: update database configuration
Browse files Browse the repository at this point in the history
Signed-off-by: Otavio Santana <otaviopolianasantana@gmail.com>
  • Loading branch information
otaviojava committed Mar 2, 2024
1 parent ec83aee commit 27c201a
Show file tree
Hide file tree
Showing 20 changed files with 3 additions and 5,895 deletions.
Expand Up @@ -33,11 +33,10 @@
* <p>Implementations of this interface should be aware of the underlying provider implementation they represent,
* and ensure that the correct configuration is returned based on the provided type.</p>
*
* @param <R> the {@link DatabaseManagerFactory} type
* @see DatabaseManagerFactory
* @see DatabaseManager
*/
public interface DatabaseConfiguration<R extends DatabaseManagerFactory> extends Function<Settings, R> {
public interface DatabaseConfiguration extends Function<Settings, DatabaseManagerFactory> {


/**
Expand All @@ -52,7 +51,7 @@ public interface DatabaseConfiguration<R extends DatabaseManagerFactory> extends
* @throws CommunicationException if no implementation of {@link DatabaseConfiguration} is found
*/
@SuppressWarnings("unchecked")
static <R extends DatabaseManagerFactory, T extends DatabaseConfiguration<R>> T getConfiguration() {
static <R extends DatabaseManagerFactory, T extends DatabaseConfiguration> T getConfiguration() {
return (T) ServiceLoader.load(DatabaseConfiguration.class)
.stream()
.map(ServiceLoader.Provider::get)
Expand All @@ -74,7 +73,7 @@ static <R extends DatabaseManagerFactory, T extends DatabaseConfiguration<R>> T
* @throws CommunicationException if no implementation of {@link DatabaseConfiguration} is found for the specified type
*/
@SuppressWarnings("unchecked")
static <R extends DatabaseManagerFactory, T extends DatabaseConfiguration<R>> T getConfiguration(Class<T> type) {
static <R extends DatabaseManagerFactory, T extends DatabaseConfiguration> T getConfiguration(Class<T> type) {
return (T) ServiceLoader.load(DatabaseConfiguration.class)
.stream()
.map(ServiceLoader.Provider::get)
Expand Down

This file was deleted.

0 comments on commit 27c201a

Please sign in to comment.