public interface BaseProperties
Modifier and Type | Method and 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 a
boolean property value by name. |
default boolean |
getBooleanProperty(java.lang.String name,
boolean defaultIfNull)
Retrieves a
boolean property value by name, with a default if it's null . |
java.lang.Integer |
getIntProperty(java.lang.String name)
Retrieves an
int property value by name. |
default int |
getIntProperty(java.lang.String name,
int defaultIfNull)
Retrieves an
int property value by name, with a default if it's null . |
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's
null . |
void |
setBooleanProperty(java.lang.String name,
java.lang.Boolean value)
Sets a
boolean property by name. |
void |
setIntProperty(java.lang.String name,
java.lang.Integer value)
Sets an
int property by name. |
void |
setProperty(java.lang.String name,
java.lang.String value)
Sets a property by name.
|
java.lang.String getProperty(java.lang.String name)
For properties with an explicit default, this method should return the string presentation of that default, not
null
. For int
or boolean
the string equivalent is returned.
name
- Property name (not null
or empty)null
when not set or not a known propertydefault java.lang.String getProperty(java.lang.String name, java.lang.String defaultIfNull)
null
.name
- Property name (not null
or empty)defaultIfNull
when not set or not a known propertyvoid setProperty(java.lang.String name, java.lang.String value)
This method can be used to set all defined properties, but also properties not known by Jaybird. When setting
int
or boolean
properties, the appropriate conversions are applied. Using null
will
reset to the default value. For boolean
properties, an empty string is taken to mean true
.
name
- Property name (not null
or empty)value
- Property value (use null
to apply default)java.lang.IllegalArgumentException
- When the specified property is an int
or boolean
property and the value is not
null
and not a valid int
or boolean
java.lang.Integer getIntProperty(java.lang.String name)
int
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 an int
property
name
- Property name (not null
or empty)null
when not setjava.lang.NumberFormatException
- If the property is not an int property
and the value cannot be converted to an integerjava.lang.IllegalArgumentException
- (optional) If the specified property is not an int
propertydefault int getIntProperty(java.lang.String name, int defaultIfNull)
int
property value by name, with a default if it's null
.name
- Property name (not null
or empty)defaultIfNull
- Default value when null
defaultIfNull
when the value is null
getIntProperty(String)
void setIntProperty(java.lang.String name, java.lang.Integer value)
int
property by name.
For implementation simplicity, it is allowed to also set string properties. The value set will be the string equivalent.
name
- Property name (not null
or empty)value
- Property value (use null
to apply default)java.lang.IllegalArgumentException
- If the specified property is a boolean
propertyjava.lang.Boolean getBooleanProperty(java.lang.String name)
boolean
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 an int
property
name
- Property name (not null
or empty)null
when not setjava.lang.IllegalArgumentException
- If the property value is not null
and cannot be converted to a boolean (true
or empty
string, false
), (optional) if the specified property is not a boolean
propertydefault boolean getBooleanProperty(java.lang.String name, boolean defaultIfNull)
boolean
property value by name, with a default if it's null
.name
- Property name (not null
or empty)defaultIfNull
- Default value when null
defaultIfNull
when the value is null
getBooleanProperty(String)
void setBooleanProperty(java.lang.String name, java.lang.Boolean value)
boolean
property by name.
For implementation simplicity, it is allowed to also set string properties. The value set will be the string equivalent.
name
- Property name (not null
or empty)value
- Property value (use null
to apply default)java.lang.IllegalArgumentException
- If the specified property is an int
propertyjava.util.Map<ConnectionProperty,java.lang.Object> connectionPropertyValues()
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.
Copyright © 2001-2024 Jaybird (Firebird JDBC) team. All rights reserved.