Package com.ohalee.database.redis
Record Class RedisCredentials
java.lang.Object
java.lang.Record
com.ohalee.database.redis.RedisCredentials
- Record Components:
host- The hostname of the Redis server.port- The port of the Redis server.username- The username for authentication (optional).password- The password for authentication (optional).database- The database index to use.minimumPoolSize- The minimum number of idle connections in the pool.maximumPoolSize- The maximum number of connections in the pool.
- All Implemented Interfaces:
com.ohalee.database.api.DatabaseCredentials
public record RedisCredentials(String host, int port, String username, String password, int database, String clientName, int minimumPoolSize, int maximumPoolSize)
extends Record
implements com.ohalee.database.api.DatabaseCredentials
Credentials for connecting to a Redis database.
-
Constructor Summary
ConstructorsConstructorDescriptionRedisCredentials(String host, int port, String username, String password, int database, String clientName, int minimumPoolSize, int maximumPoolSize) Creates an instance of aRedisCredentialsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theclientNamerecord component.intdatabase()Returns the value of thedatabaserecord component.final booleanIndicates whether some other object is "equal to" this one.static RedisCredentialsCreates credentials with the default port (6379), default pool settings (min 5, max 10), and database 0.static RedisCredentialsCreates credentials with default pool settings (min 5, max 10) and database 0.static RedisCredentialsCreates credentials with default pool settings (min 5, max 10).static RedisCredentialsCreates credentials with default pool settings (min 5, max 10).static RedisCredentialsfrom(String host, int port, String username, String password, int database, int minimumPoolSize, int maximumPoolSize) Creates credentials with specified pool settings.static RedisCredentialsfrom(String host, int port, String username, String password, int database, String clientName, int minimumPoolSize, int maximumPoolSize) Creates credentials with specified pool settings.static RedisCredentialsCreates credentials with the default port (6379), default pool settings (min 5, max 10), and database 0.final inthashCode()Returns a hash code value for this object.host()Returns the value of thehostrecord component.intReturns the value of themaximumPoolSizerecord component.intReturns the value of theminimumPoolSizerecord component.password()Returns the value of thepasswordrecord component.intport()Returns the value of theportrecord component.final StringtoString()Returns a string representation of this record class.username()Returns the value of theusernamerecord component.
-
Constructor Details
-
RedisCredentials
public RedisCredentials(String host, int port, String username, String password, int database, String clientName, int minimumPoolSize, int maximumPoolSize) Creates an instance of aRedisCredentialsrecord class.- Parameters:
host- the value for thehostrecord componentport- the value for theportrecord componentusername- the value for theusernamerecord componentpassword- the value for thepasswordrecord componentdatabase- the value for thedatabaserecord componentclientName- the value for theclientNamerecord componentminimumPoolSize- the value for theminimumPoolSizerecord componentmaximumPoolSize- the value for themaximumPoolSizerecord component
-
-
Method Details
-
from
Creates credentials with the default port (6379), default pool settings (min 5, max 10), and database 0.- Parameters:
host- The hostname.- Returns:
- The Redis credentials.
-
from
Creates credentials with the default port (6379), default pool settings (min 5, max 10), and database 0.- Parameters:
host- The hostname.password- The password.- Returns:
- The Redis credentials.
-
from
Creates credentials with default pool settings (min 5, max 10) and database 0.- Parameters:
host- The hostname.port- The port.password- The password.- Returns:
- The Redis credentials.
-
from
Creates credentials with default pool settings (min 5, max 10).- Parameters:
host- The hostname.port- The port.username- The username.password- The password.- Returns:
- The Redis credentials.
-
from
public static RedisCredentials from(String host, int port, String username, String password, int database) Creates credentials with default pool settings (min 5, max 10).- Parameters:
host- The hostname.port- The port.username- The username.password- The password.database- The database index.- Returns:
- The Redis credentials.
-
from
public static RedisCredentials from(String host, int port, String username, String password, int database, int minimumPoolSize, int maximumPoolSize) Creates credentials with specified pool settings.- Parameters:
host- The hostname.port- The port.username- The username.password- The password.database- The database index.minimumPoolSize- The minimum pool size.maximumPoolSize- The maximum pool size.- Returns:
- The Redis credentials.
-
from
public static RedisCredentials from(String host, int port, String username, String password, int database, String clientName, int minimumPoolSize, int maximumPoolSize) Creates credentials with specified pool settings.- Parameters:
host- The hostname.port- The port.username- The username.password- The password.database- The database index.clientName- The client name.minimumPoolSize- The minimum pool size.maximumPoolSize- The maximum pool size.- Returns:
- The Redis credentials.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
host
Returns the value of thehostrecord component.- Returns:
- the value of the
hostrecord component
-
port
public int port()Returns the value of theportrecord component.- Returns:
- the value of the
portrecord component
-
username
Returns the value of theusernamerecord component.- Returns:
- the value of the
usernamerecord component
-
password
Returns the value of thepasswordrecord component.- Returns:
- the value of the
passwordrecord component
-
database
public int database()Returns the value of thedatabaserecord component.- Returns:
- the value of the
databaserecord component
-
clientName
Returns the value of theclientNamerecord component.- Returns:
- the value of the
clientNamerecord component
-
minimumPoolSize
public int minimumPoolSize()Returns the value of theminimumPoolSizerecord component.- Returns:
- the value of the
minimumPoolSizerecord component
-
maximumPoolSize
public int maximumPoolSize()Returns the value of themaximumPoolSizerecord component.- Returns:
- the value of the
maximumPoolSizerecord component
-