The Diffusion Publisher API is deprecated and will be removed in a future release.
@Deprecated public interface PropertyHandler
Such properties are typically loaded from a properties file.
Modifier and Type | Method and Description |
---|---|
boolean |
getBooleanProperty(String key)
Deprecated.
Gets the value of a boolean property.
|
int |
getBytesProperty(String key)
Deprecated.
Converts a size into bytes.
|
int |
getBytesProperty(String key,
int defaultValue)
Deprecated.
Converts a size into bytes.
|
double |
getDoubleProperty(String key)
Deprecated.
Get a double property.
|
int |
getIntegerProperty(String key)
Deprecated.
Get an integer property.
|
int |
getIntegerProperty(String key,
int defaultValue)
Deprecated.
Get an integer property if it exists otherwise return a default value.
|
List<String> |
getListProperty(String key)
Deprecated.
Gets the value of a list property.
|
long |
getLongProperty(String key)
Deprecated.
Get a long property.
|
long |
getLongProperty(String key,
long defaultValue)
Deprecated.
Get an long property if it exists otherwise return a default value.
|
String |
getMandatoryProperty(String key)
Deprecated.
Get a mandatory property.
|
long |
getMillisProperty(String key)
Deprecated.
Converts a time into milliseconds.
|
long |
getMillisProperty(String key,
long defaultValue)
Deprecated.
Converts a time into milliseconds.
|
String |
getProperty(String key)
Deprecated.
Get a property.
|
String |
getProperty(String key,
String defaultValue)
Deprecated.
Get a property if it exists otherwise return a default value.
|
String |
getProperty(String key,
String defaultValue,
String... allowedValues)
Deprecated.
Get a property if it exists and validate it against a set of allowed
values.
|
Set<String> |
getSetProperty(String key)
Deprecated.
Gets the value of a set property.
|
boolean |
hasProperties()
Deprecated.
Test to see if there are any properties.
|
boolean |
propertyExists(String key)
Deprecated.
Indicates whether a value for a particular property exists.
|
void |
setProperty(String key,
String value)
Deprecated.
Sets a property value.
|
boolean propertyExists(String key)
key
- the property key.String getProperty(String key)
key
- the property key.String getProperty(String key, String defaultValue)
key
- the property key.defaultValue
- the default value to return if the property is not
declared.String getProperty(String key, String defaultValue, String... allowedValues) throws PropertyException
If the property does not exist then a default value is returned.
key
- the property key.defaultValue
- the default value to return if the property is not
declared.allowedValues
- a list of permitted values. If this list is not
supplied then any value would be permitted. The case of the values
is not significant and thus any of the values is permitted in any
case.PropertyException
- if the property existed but was not equal to
one of the allowed values.String getMandatoryProperty(String key) throws PropertyException
key
- the property key.PropertyException
- is the property is not declared.void setProperty(String key, String value)
key
- the property keyvalue
- the property valueint getIntegerProperty(String key) throws PropertyException
key
- the property key.PropertyException
- if the property does not exist, is zero length
or whitespace, or is not a valid integer value.int getIntegerProperty(String key, int defaultValue) throws PropertyException
key
- the property key.defaultValue
- the value to return if the property does not exist.PropertyException
- if the property did exist but was not a valid
integer value.long getLongProperty(String key) throws PropertyException
key
- the property key.PropertyException
- if the property does not exist, is zero length
or whitespace, or is not a valid long value.double getDoubleProperty(String key) throws PropertyException
key
- the property key.PropertyException
- if the property does not exist, is zero length
or whitespace, or is not a valid double value.long getLongProperty(String key, long defaultValue) throws PropertyException
key
- the property key.defaultValue
- the value to return if the property does not exist.PropertyException
- if the property did exist but was not a valid
long value.List<String> getListProperty(String key)
A list property is interpreted as a list of values separated by '&' characters.
If you wish to eliminate duplicates from a list then use
getSetProperty(String)
.
key
- the property key.Set<String> getSetProperty(String key)
A set property is interpreted as a list of values separated by '&' characters. This differs from a list property in that because a set is returned, duplicates are removed. The set order is the same as the list within the properties.
key
- the property key.boolean getBooleanProperty(String key)
key
- the property key.int getBytesProperty(String key) throws PropertyException
key
- the property key.PropertyException
- if the named property can not be converted into
a bytes valueint getBytesProperty(String key, int defaultValue) throws PropertyException
key
- the property key.defaultValue
- the value to return if the property does not existPropertyException
- if the specified property value can not be
converted into a bytes valuelong getMillisProperty(String key) throws PropertyException
key
- the property key.PropertyException
- if the specified property can not be converted
into a milliseconds valuelong getMillisProperty(String key, long defaultValue) throws PropertyException
key
- the property key.defaultValue
- the value to return if the property does not existPropertyException
- if the specified property can not be converted
into a milliseconds valueboolean hasProperties()
Copyright © 2020 Push Technology Ltd. All Rights Reserved.