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 BasePropertiesBase 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.BooleangetBooleanProperty(java.lang.String name)Retrieves abooleanproperty value by name.default booleangetBooleanProperty(java.lang.String name, boolean defaultIfNull)Retrieves abooleanproperty value by name, with a default if it'snull.java.lang.IntegergetIntProperty(java.lang.String name)Retrieves anintproperty value by name.default intgetIntProperty(java.lang.String name, int defaultIfNull)Retrieves anintproperty value by name, with a default if it'snull.java.lang.StringgetProperty(java.lang.String name)Retrieves a string property value by name.default java.lang.StringgetProperty(java.lang.String name, java.lang.String defaultIfNull)Retrieves a string property value by name, with a default if it'snull.voidsetBooleanProperty(java.lang.String name, java.lang.Boolean value)Sets abooleanproperty by name.voidsetIntProperty(java.lang.String name, java.lang.Integer value)Sets anintproperty by name.voidsetProperty(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. 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
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 (notnullor empty)- Returns:
- Value of the property, or
defaultIfNullwhen 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
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:
java.lang.IllegalArgumentException- When the specified property is anintorbooleanproperty and the value is notnulland not a validintorboolean
-
getIntProperty
java.lang.Integer getIntProperty(java.lang.String name)
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:
java.lang.NumberFormatException- If the property is not anint propertyand the value cannot be converted to an integerjava.lang.IllegalArgumentException- (optional) If the specified property is not anintproperty
-
getIntProperty
default int getIntProperty(java.lang.String name, int defaultIfNull)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:
getIntProperty(String)
-
setIntProperty
void setIntProperty(java.lang.String name, java.lang.Integer value)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:
java.lang.IllegalArgumentException- If the specified property is abooleanproperty
-
getBooleanProperty
java.lang.Boolean getBooleanProperty(java.lang.String name)
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 anintproperty- Parameters:
name- Property name (notnullor empty)- Returns:
- Integer with value of the property, or
nullwhen not set - Throws:
java.lang.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
default boolean getBooleanProperty(java.lang.String name, boolean defaultIfNull)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:
getBooleanProperty(String)
-
setBooleanProperty
void setBooleanProperty(java.lang.String name, java.lang.Boolean value)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:
java.lang.IllegalArgumentException- If the specified property is anintproperty
-
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
-
-