- 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
- Since:
- 5
- Author:
- Mark Rotteveel
-
Method Summary
Modifier and TypeMethodDescriptionAn unmodifiable view on the connection properties held by this BaseProperties implementation.getBooleanProperty
(String name) Retrieves aboolean
property value by name.default boolean
getBooleanProperty
(String name, boolean defaultIfNull) Retrieves aboolean
property value by name, with a default if it'snull
.getIntProperty
(String name) Retrieves anint
property value by name.default int
getIntProperty
(String name, int defaultIfNull) Retrieves anint
property value by name, with a default if it'snull
.getProperty
(String name) Retrieves a string property value by name.default String
getProperty
(String name, String defaultIfNull) Retrieves a string property value by name, with a default if it'snull
.void
setBooleanProperty
(String name, Boolean value) Sets aboolean
property by name.void
setIntProperty
(String name, Integer value) Sets anint
property by name.void
setProperty
(String name, String value) Sets a property by name.
-
Method Details
-
getProperty
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
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
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:
IllegalArgumentException
- When the specified property is anint
orboolean
property and the value is notnull
and not a validint
orboolean
-
getIntProperty
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:
NumberFormatException
- If the property is not anint property
and the value cannot be converted to an integerIllegalArgumentException
- (optional) If the specified property is not anint
property
-
getIntProperty
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:
-
setIntProperty
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:
IllegalArgumentException
- If the specified property is aboolean
property
-
getBooleanProperty
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 aboolean
property- Parameters:
name
- Property name (notnull
or empty)- Returns:
- Integer with value of the property, or
null
when not set - Throws:
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
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:
-
setBooleanProperty
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:
IllegalArgumentException
- If the specified property is anint
property
-
connectionPropertyValues
Map<ConnectionProperty,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
-