Package io.deephaven.configuration
Class PropertyFile
java.lang.Object
io.deephaven.configuration.PropertyFile
- Direct Known Subclasses:
Configuration
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCreates an empty PropertyFilePropertyFile
(String filename, Logger log, boolean fatal) Create a PropertyFile and load properties from the given file. -
Method Summary
Modifier and TypeMethodDescriptionboolean
getBoolean
(String propertyName) boolean
getBoolean
(String propertyName, Logger logger, String logPrefix) boolean
getBooleanForClass
(Class c, String propertyLast) boolean
getBooleanForClassWithDefault
(Class c, String propertyLast, boolean defaultValue) boolean
getBooleanWithDefault
(String propertyName, boolean defaultValue) char
void
getClassParams
(Logger log, Class c, Object obj) void
getClassParams
(Logger log, Class c, String name, Object obj) void
getClassParams
(Logger log, Class c, String instanceStr, Object obj, int desiredMods) void
getClassParams
(Class c, Object obj) double
double
double
getDoubleForClass
(Class c, String propertyLast) double
getDoubleForClassWithDefault
(Class c, String propertyLast, double defaultValue) double
getDoubleWithDefault
(String propertyName, double defaultValue) int[]
getIntArrayForClass
(Class c, String propertyLast) int
getInteger
(String propertyName) int
getInteger
(String propertyName, Logger logger, String logPrefix) int[]
getIntegerArray
(String propertyName) int
getIntegerForClass
(Class c, String propertyLast) int
getIntegerForClassWithDefault
(Class c, String propertyLast, int defaultValue) int
getIntegerWithDefault
(String propertyName, int defaultValue) gnu.trove.set.hash.TIntHashSet
getIntHashSetForClass
(Class c, String propertyLast) gnu.trove.set.hash.TIntHashSet
getIntHashSetFromProperty
(String propertyName) long
long
long[]
getLongArray
(String propertyName) long
getLongForClass
(Class c, String propertyLast) long
getLongForClassWithDefault
(Class c, String propertyLast, long defaultValue) long
getLongWithDefault
(String propertyName, long defaultValue) getNameStringMapFromProperty
(String propertyName) getNameStringSetFromProperty
(String propertyName) gnu.trove.set.TIntSet
getNonNegativeIntSetWithRangeSupport
(String propertyName) Parse a set of non-negative ints from a property.int
getPositiveInteger
(String propertyName) int
getPossibleIntegerWithDefault
(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 String
getProperty
(String propertyName) Gets the value of the given property, aborting if the value is not specified in the system config files.short
short
long
getShortForClass
(Class c, String propertyLast) short
getShortWithDefault
(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) boolean
hasProperty
(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
-