Package uk.ac.diamond.daq.configuration
Class BeamlineConfigurationService
java.lang.Object
uk.ac.diamond.daq.configuration.BeamlineConfigurationService
- All Implemented Interfaces:
BeamlineConfiguration,PropertyService
public class BeamlineConfigurationService
extends Object
implements BeamlineConfiguration, PropertyService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidThe properties made available directly rather than loaded via filesbooleangetAsBoolean(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.getAsString(String property, String defaultValue) Get the value of a property as aStringwith a default.booleanCheck if a property is set.org.apache.commons.configuration2.Configurationproperties(Predicate<String> keyFilter) voidSets a property to the provided value.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface uk.ac.diamond.daq.configuration.BeamlineConfiguration
asPropertiesConfigMethods inherited from interface uk.ac.diamond.daq.services.PropertyService
get, getAsString
-
Constructor Details
-
BeamlineConfigurationService
public BeamlineConfigurationService()
-
-
Method Details
-
activate
-
getSpringXml
- Specified by:
getSpringXmlin interfaceBeamlineConfiguration
-
getPropertiesFiles
- Specified by:
getPropertiesFilesin interfaceBeamlineConfiguration
-
getLoggingConfiguration
- Specified by:
getLoggingConfigurationin interfaceBeamlineConfiguration
-
getProfiles
- Specified by:
getProfilesin interfaceBeamlineConfiguration
-
properties
public org.apache.commons.configuration2.Configuration properties()- Specified by:
propertiesin interfaceBeamlineConfiguration
-
properties
- Specified by:
propertiesin interfaceBeamlineConfiguration
-
directProperties
Description copied from interface:BeamlineConfigurationThe properties made available directly rather than loaded via files- Specified by:
directPropertiesin interfaceBeamlineConfiguration
-
getAsString
Description copied from interface:PropertyServiceGet the value of a property as aStringwith a default.- Specified by:
getAsStringin interfacePropertyService- 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
Description copied from interface:PropertyServiceGet 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.- Specified by:
getAsIntin interfacePropertyService- 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
Description copied from interface:PropertyServiceGet 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.- Specified by:
getAsDoublein interfacePropertyService- 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
Description copied from interface:PropertyServiceGet 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.- Specified by:
getAsBooleanin interfacePropertyService- 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
Description copied from interface:PropertyServiceCheck if a property is set.- Specified by:
isSetin interfacePropertyService- Parameters:
property- The property to lookup- Returns:
trueif the property is set,falseotherwise
-
set
Description copied from interface:PropertyServiceSets 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.
- Specified by:
setin interfacePropertyService- Parameters:
property- The property to setvalue- The value to set the property to
-