Interface BaseProperties
-
- All Known Subinterfaces:
AttachmentProperties
,BackupManager
,DatabaseConnectionProperties
,EventManager
,FirebirdConnectionProperties
,IAttachProperties<T>
,IConnectionProperties
,IServiceProperties
,MaintenanceManager
,NBackupManager
,ServiceConnectionProperties
,ServiceManager
,StatisticsManager
,TraceManager
,UserManager
- All Known Implementing Classes:
AbstractAttachProperties
,AbstractConnectionPropertiesDataSource
,AbstractImmutableAttachProperties
,FBAbstractCommonDataSource
,FBBackupManager
,FBBackupManagerBase
,FBConnectionPoolDataSource
,FbConnectionProperties
,FBConnectionProperties
,FBEventManager
,FbImmutableConnectionProperties
,FbImmutableServiceProperties
,FBMaintenanceManager
,FBManagedConnectionFactory
,FBNBackupManager
,FBServiceManager
,FbServiceProperties
,FBSimpleDataSource
,FBStatisticsManager
,FBStreamingBackupManager
,FBTraceManager
,FBUserManager
,FBXADataSource
public interface BaseProperties
Base of the properties hierarchy; provides common API for setting properties by name.- Since:
- 5
- Author:
- Mark Rotteveel
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.Map<ConnectionProperty,java.lang.Object>
connectionPropertyValues()
An unmodifiable view on the connection properties held by this BaseProperties implementation.java.lang.Boolean
getBooleanProperty(java.lang.String name)
Retrieves aboolean
property value by name.default boolean
getBooleanProperty(java.lang.String name, boolean defaultIfNull)
Retrieves aboolean
property value by name, with a default if it'snull
.java.lang.Integer
getIntProperty(java.lang.String name)
Retrieves anint
property value by name.default int
getIntProperty(java.lang.String name, int defaultIfNull)
Retrieves anint
property value by name, with a default if it'snull
.java.lang.String
getProperty(java.lang.String name)
Retrieves a string property value by name.default java.lang.String
getProperty(java.lang.String name, java.lang.String defaultIfNull)
Retrieves a string property value by name, with a default if it'snull
.void
setBooleanProperty(java.lang.String name, java.lang.Boolean value)
Sets aboolean
property by name.void
setIntProperty(java.lang.String name, java.lang.Integer value)
Sets anint
property by name.void
setProperty(java.lang.String name, java.lang.String value)
Sets a property by name.
-
-
-
Method Detail
-
getProperty
java.lang.String getProperty(java.lang.String name)
Retrieves a string property value by name.For properties with an explicit default, this method should return the string presentation of that default, not
null
. Forint
orboolean
the string equivalent is returned.- Parameters:
name
- Property name (notnull
or empty)- Returns:
- Value of the property, or
null
when not set or not a known property
-
getProperty
default java.lang.String getProperty(java.lang.String name, java.lang.String defaultIfNull)
Retrieves a string property value by name, with a default if it'snull
.- Parameters:
name
- Property name (notnull
or empty)- Returns:
- Value of the property, or
defaultIfNull
when not set or not a known property
-
setProperty
void setProperty(java.lang.String name, java.lang.String value)
Sets a property by name.This method can be used to set all defined properties, but also properties not known by Jaybird. When setting
int
orboolean
properties, the appropriate conversions are applied. Usingnull
will reset to the default value. Forboolean
properties, an empty string is taken to meantrue
.- Parameters:
name
- Property name (notnull
or empty)value
- Property value (usenull
to apply default)- Throws:
java.lang.IllegalArgumentException
- When the specified property is anint
orboolean
property and the value is notnull
and not a validint
orboolean
-
getIntProperty
java.lang.Integer getIntProperty(java.lang.String name)
Retrieves anint
property value by name.For properties with an explicit default, this method should return the integer presentation of that default. For implementation simplicity, it is allowed to convert any string property to
int
instead of checking if something is actually anint
property- Parameters:
name
- Property name (notnull
or empty)- Returns:
- Integer with value of the property, or
null
when not set - Throws:
java.lang.NumberFormatException
- If the property is not anint property
and the value cannot be converted to an integerjava.lang.IllegalArgumentException
- (optional) If the specified property is not anint
property
-
getIntProperty
default int getIntProperty(java.lang.String name, int defaultIfNull)
Retrieves anint
property value by name, with a default if it'snull
.- Parameters:
name
- Property name (notnull
or empty)defaultIfNull
- Default value whennull
- Returns:
- The value or
defaultIfNull
when the value isnull
- See Also:
getIntProperty(String)
-
setIntProperty
void setIntProperty(java.lang.String name, java.lang.Integer value)
Sets anint
property by name.For implementation simplicity, it is allowed to also set string properties. The value set will be the string equivalent.
- Parameters:
name
- Property name (notnull
or empty)value
- Property value (usenull
to apply default)- Throws:
java.lang.IllegalArgumentException
- If the specified property is aboolean
property
-
getBooleanProperty
java.lang.Boolean getBooleanProperty(java.lang.String name)
Retrieves aboolean
property value by name.For properties with an explicit default, this method should return the boolean presentation of that default. For implementation simplicity, it is allowed to convert any string property to
boolean
instead of checking if something is actually anint
property- Parameters:
name
- Property name (notnull
or empty)- Returns:
- Integer with value of the property, or
null
when not set - Throws:
java.lang.IllegalArgumentException
- If the property value is notnull
and cannot be converted to a boolean (true
or empty string,false
), (optional) if the specified property is not aboolean
property
-
getBooleanProperty
default boolean getBooleanProperty(java.lang.String name, boolean defaultIfNull)
Retrieves aboolean
property value by name, with a default if it'snull
.- Parameters:
name
- Property name (notnull
or empty)defaultIfNull
- Default value whennull
- Returns:
- The value or
defaultIfNull
when the value isnull
- See Also:
getBooleanProperty(String)
-
setBooleanProperty
void setBooleanProperty(java.lang.String name, java.lang.Boolean value)
Sets aboolean
property by name.For implementation simplicity, it is allowed to also set string properties. The value set will be the string equivalent.
- Parameters:
name
- Property name (notnull
or empty)value
- Property value (usenull
to apply default)- Throws:
java.lang.IllegalArgumentException
- If the specified property is anint
property
-
connectionPropertyValues
java.util.Map<ConnectionProperty,java.lang.Object> connectionPropertyValues()
An unmodifiable view on the connection properties held by this BaseProperties implementation.Be aware, implementations can have additional properties that are not mapped from
ConnectionProperty
. Such properties will need to be retrieved in an implementation-specific manner.- Returns:
- An unmodifiable view on the property values held in this properties instance
-
-