Skip to content

Commit

Permalink
docs: enhance database manager factory
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 ef05d03 commit 17da25f
Showing 1 changed file with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,28 @@
import java.util.function.Function;

/**
* The manager factory instance creates a manager instance from the database name.
* It should return a {@link NullPointerException} when the {@link String} parameter is null.
* This interface represents a factory for creating database manager instances based on a database name.
* It should throw a {@link NullPointerException} when the {@link String} parameter is null.
*
* <p>The {@link DatabaseManagerFactory} extends {@link java.util.function.Function}, indicating that it can be
* used as a function to create database manager instances from database names.</p>
*
* <p>Implementations of this interface are expected to provide the necessary logic to instantiate appropriate
* {@link DatabaseManager} instances based on the provided database name.</p>
*
* <p>Additionally, this interface extends {@link AutoCloseable}, indicating that implementations may manage
* resources that require cleanup. The {@link #close()} method should be called to release any resources
* held by the factory.</p>
*
* @see DatabaseManager
*/
public interface DatabaseManagerFactory extends Function<String, DatabaseManager>, AutoCloseable {


/**
* closes a resource
* Closes any resources held by the factory.
*
* <p>Note: Some databases may not perform any specific actions upon closing.</p>
*/
void close();
}

0 comments on commit 17da25f

Please sign in to comment.