Package io.deephaven.configuration
Class PropertyFile
java.lang.Object
io.deephaven.configuration.PropertyFile
- Direct Known Subclasses:
Configuration
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty PropertyFilePropertyFile(String filename, Logger log, boolean fatal) Create a PropertyFile and load properties from the given file. -
Method Summary
Modifier and TypeMethodDescriptionbooleangetBoolean(String propertyName) booleangetBoolean(String propertyName, Logger logger, String logPrefix) booleangetBooleanForClass(Class c, String propertyLast) booleangetBooleanForClassWithDefault(Class c, String propertyLast, boolean defaultValue) booleangetBooleanWithDefault(String propertyName, boolean defaultValue) charvoidgetClassParams(Logger log, Class c, Object obj) voidgetClassParams(Logger log, Class c, String name, Object obj) voidgetClassParams(Logger log, Class c, String instanceStr, Object obj, int desiredMods) voidgetClassParams(Class c, Object obj) doubledoubledoublegetDoubleForClass(Class c, String propertyLast) doublegetDoubleForClassWithDefault(Class c, String propertyLast, double defaultValue) doublegetDoubleWithDefault(String propertyName, double defaultValue) int[]getIntArrayForClass(Class c, String propertyLast) intgetInteger(String propertyName) intgetInteger(String propertyName, Logger logger, String logPrefix) int[]getIntegerArray(String propertyName) intgetIntegerForClass(Class c, String propertyLast) intgetIntegerForClassWithDefault(Class c, String propertyLast, int defaultValue) intgetIntegerWithDefault(String propertyName, int defaultValue) gnu.trove.set.hash.TIntHashSetgetIntHashSetForClass(Class c, String propertyLast) gnu.trove.set.hash.TIntHashSetgetIntHashSetFromProperty(String propertyName) longlonglong[]getLongArray(String propertyName) longgetLongForClass(Class c, String propertyLast) longgetLongForClassWithDefault(Class c, String propertyLast, long defaultValue) longgetLongWithDefault(String propertyName, long defaultValue) getNameStringMapFromProperty(String propertyName) getNameStringSetFromProperty(String propertyName) gnu.trove.set.TIntSetgetNonNegativeIntSetWithRangeSupport(String propertyName) Parse a set of non-negative ints from a property.intgetPositiveInteger(String propertyName) intgetPossibleIntegerWithDefault(int defaultValue, String... possiblePropertyNames) getPossibleStringWithDefault(String defaultValue, String... possiblePropertyNames) Return the Properties object loaded by this property file.getProperties(String prefix) Collect all of the properties in this property file that begin with a given prefix.@NotNull StringgetProperty(String propertyName) Gets the value of the given property, aborting if the value is not specified in the system config files.shortshortlonggetShortForClass(Class c, String propertyLast) shortgetShortWithDefault(String propertyName, short defaultValue) String[]getStringArrayFromProperty(String propertyName) String[]getStringArrayFromPropertyWithDefault(String propertyName, String[] defaultValue) getStringForClass(Class c, String propertyLast) getStringForClassWithDefault(Class c, String propertyLast, String defaultValue) gnu.trove.map.hash.TObjectIntHashMap<String>getStringIntHashMap(String propertyName, String separator) getStringSetFromProperty(String propertyName) getStringSetFromPropertyForClass(Class c, String propertyLast) getStringSetFromPropertyWithDefault(String propertyName, Set<String> defaultValue) getStringWithDefault(String propertyName, String defaultValue) booleanhasProperty(String propertyName) setProperty(String key, String value) Sets the value of a given property
-
Field Details
-
log
-
properties
-
-
Constructor Details
-
PropertyFile
public PropertyFile()Creates an empty PropertyFile -
PropertyFile
Create a PropertyFile and load properties from the given file.- Parameters:
filename- name of file to load properties fromlog- Logger for error/warning messages, or null if not loggingfatal- If the file can't be read and fatal is true -> throw exception
-
-
Method Details
-
getProperties
Return the Properties object loaded by this property file.- Returns:
- the Properties object.
-
getProperties
Collect all of the properties in this property file that begin with a given prefix.- Returns:
- a new Properties object containing the selected properties, with the prefix removed.
-
setProperty
Sets the value of a given property- Parameters:
key- an identifier for the propertyvalue- the value for the property- Returns:
- the previous value of the property
-
getProperty
Gets the value of the given property, aborting if the value is not specified in the system config files. Note that it is by design that there is no overloaded method taking a default value. Rather than scattering default values through all the source files, all properties should be in one config file (as much as possible). Put default values in common.prop. -
getChar
-
getInteger
-
getPositiveInteger
-
getShort
-
getLong
-
getDouble
-
getBoolean
-
getBooleanWithDefault
-
getLongWithDefault
-
getShortWithDefault
-
getIntegerWithDefault
-
getPossibleIntegerWithDefault
-
getStringWithDefault
-
getPossibleStringWithDefault
-
getDoubleWithDefault
-
getBoolean
-
getInteger
-
getShort
-
getLong
-
getDouble
-
getString
-
getBooleanForClass
-
getBooleanForClassWithDefault
-
getIntegerForClass
-
getIntegerForClassWithDefault
-
getShortForClass
-
getLongForClass
-
getLongForClassWithDefault
-
getDoubleForClass
-
getDoubleForClassWithDefault
-
getStringForClass
-
hasProperty
-
getStringForClassWithDefault
-
getIntHashSetForClass
-
getIntArrayForClass
-
getClassParams
-
getClassParams
-
getClassParams
-
getClassParams
-
getIntHashSetFromProperty
-
getStringSetFromProperty
-
getStringSetFromPropertyWithDefault
-
getStringArrayFromProperty
-
getStringArrayFromPropertyWithDefault
-
getStringSetFromPropertyForClass
-
getNameStringSetFromProperty
-
getNameStringMapFromProperty
-
getIntegerArray
-
getNonNegativeIntSetWithRangeSupport
Parse a set of non-negative ints from a property. Format is comma-separated individual values and ranges of the form start-end.- Parameters:
propertyName-- Returns:
- A set of ints derived from the specified property.
-
getBitSet
-
getStringIntHashMap
-
getLongArray
-