Package uk.ac.diamond.daq.services
Interface PropertyService
- All Known Implementing Classes:
BeamlineConfigurationService
public interface PropertyService
A service for accessing properties.
-
Method Summary
Modifier and TypeMethodDescriptiondefault StringGet the value of a property as aString.booleangetAsBoolean(String property, boolean defaultValue) Get the value of a property as abooleanwith a default.doublegetAsDouble(String property, double defaultValue) Get the value of a property as andoublewith a default.intGet the value of a property as anintwith a default.default StringgetAsString(String property) Get the value of a property as aString.getAsString(String property, String defaultValue) Get the value of a property as aStringwith a default.booleanCheck if a property is set.voidDeprecated, for removal: This API element is subject to removal in a future version.This is marked as deprecated to discourage new uses of this method.
-
Method Details
-
get
Get the value of a property as aString. Equivalent togetAsString(property, null)- Parameters:
property- The property to lookup- Returns:
- The property value or null if not set
- See Also:
-
getAsString
Get the value of a property as aString. Equivalent togetAsString(property, null)- Parameters:
property- The property to lookup- Returns:
- The property value or null if not set
- See Also:
-
getAsString
Get the value of a property as aStringwith a default.- Parameters:
property- The property to lookupdefaultValue- The value to return if the property is not set- Returns:
- The property value or the defaultValue if not set
- See Also:
-
getAsInt
Get the value of a property as anintwith a default. An attempt to convert the property value to anintwill be made, if this fails the default will be returned.- Parameters:
property- The property to lookupdefaultValue- The value to return if the property is not set- Returns:
- The property value or the defaultValue if not set
-
getAsDouble
Get the value of a property as andoublewith a default. An attempt to convert the property value to adoublewill be made, if this fails the default will be returned.- Parameters:
property- The property to lookupdefaultValue- The value to return if the property is not set- Returns:
- The property value or the defaultValue if not set
-
getAsBoolean
Get the value of a property as abooleanwith a default. An attempt to convert the property value to abooleanwill be made, if this fails the default will be returned.- Parameters:
property- The property to lookupdefaultValue- The value to return if the property is not set- Returns:
- The property value or the defaultValue if not set
-
isSet
Check if a property is set.- Parameters:
property- The property to lookup- Returns:
trueif the property is set,falseotherwise
-
set
Deprecated, for removal: This API element is subject to removal in a future version.This is marked as deprecated to discourage new uses of this method.Sets a property to the provided value. It will only be set for the life of the JVM, it will not be persisted to the property files.This method is provided to bridge support for existing code, new code should not set properties programmatically at runtime and support for this feature will be removed in the future.
- Parameters:
property- The property to setvalue- The value to set the property to
-