- 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 abooleanproperty value by name.default booleangetBooleanProperty(String name, boolean defaultIfNull) Retrieves abooleanproperty value by name, with a default if it'snull.getIntProperty(String name) Retrieves anintproperty value by name.default intgetIntProperty(String name, int defaultIfNull) Retrieves anintproperty value by name, with a default if it'snull.getProperty(String name) Retrieves a string property value by name.default StringgetProperty(String name, String defaultIfNull) Retrieves a string property value by name, with a default if it'snull.voidsetBooleanProperty(String name, Boolean value) Sets abooleanproperty by name.voidsetIntProperty(String name, Integer value) Sets anintproperty by name.voidsetProperty(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. Forintorbooleanthe string equivalent is returned.- Parameters:
name- Property name (notnullor empty)- Returns:
- Value of the property, or
nullwhen 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 (notnullor empty)- Returns:
- Value of the property, or
defaultIfNullwhen 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
intorbooleanproperties, the appropriate conversions are applied. Usingnullwill reset to the default value. Forbooleanproperties, an empty string is taken to meantrue.- Parameters:
name- Property name (notnullor empty)value- Property value (usenullto apply default)- Throws:
IllegalArgumentException- When the specified property is anintorbooleanproperty and the value is notnulland not a validintorboolean
-
getIntProperty
Retrieves anintproperty 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
intinstead of checking if something is actually anintproperty- Parameters:
name- Property name (notnullor empty)- Returns:
- Integer with value of the property, or
nullwhen not set - Throws:
NumberFormatException- If the property is not anint propertyand the value cannot be converted to an integerIllegalArgumentException- (optional) If the specified property is not anintproperty
-
getIntProperty
Retrieves anintproperty value by name, with a default if it'snull.- Parameters:
name- Property name (notnullor empty)defaultIfNull- Default value whennull- Returns:
- The value or
defaultIfNullwhen the value isnull - See Also:
-
setIntProperty
Sets anintproperty 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 (notnullor empty)value- Property value (usenullto apply default)- Throws:
IllegalArgumentException- If the specified property is abooleanproperty
-
getBooleanProperty
Retrieves abooleanproperty 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
booleaninstead of checking if something is actually abooleanproperty- Parameters:
name- Property name (notnullor empty)- Returns:
- Integer with value of the property, or
nullwhen not set - Throws:
IllegalArgumentException- If the property value is notnulland cannot be converted to a boolean (trueor empty string,false), (optional) if the specified property is not abooleanproperty
-
getBooleanProperty
Retrieves abooleanproperty value by name, with a default if it'snull.- Parameters:
name- Property name (notnullor empty)defaultIfNull- Default value whennull- Returns:
- The value or
defaultIfNullwhen the value isnull - See Also:
-
setBooleanProperty
Sets abooleanproperty 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 (notnullor empty)value- Property value (usenullto apply default)- Throws:
IllegalArgumentException- If the specified property is anintproperty
-
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
-