Package lazyj
Class FallbackProperties
java.lang.Object
java.util.Observable
lazyj.ExtProperties
lazyj.FallbackProperties
- All Implemented Interfaces:
Observer
- Since:
- May 14, 2018
- Author:
- costing
-
Constructor Summary
ConstructorsConstructorDescriptionFallbackProperties(List<ExtProperties> configProperties) A different way of passing the ordered list of configuration sets to look intoFallbackProperties(ExtProperties... configProperties) Query the given list of configuration sets in order, returning the first defined value in one of them -
Method Summary
Modifier and TypeMethodDescriptionvoidaddProvider(ExtProperties config) Append a provider to the fallback list (having thus the lowest priority)voidaddProvider(ExtProperties config, boolean first) Add another provider to the fallback list, either as the first element (with the highest priority) or as the last one (lowest priority).Get a Properties view of this object.Get the String value for a given key, returning the given default value if the key is not defined.booleanCheck if the configuration object is read only or can accept modifications to itvoidremoveProvider(ExtProperties config) Remove a provider from the fallback listvoidModify an entry of the dictionary.Methods inherited from class lazyj.ExtProperties
addPropertyChangeListener, clearCache, getb, getConfigFileName, getd, geti, getl, gets, gets, makeReadOnly, parseOption, reload, removePropertyChangeListener, setAutoReload, size, toString, toVector, updateMethods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
-
Constructor Details
-
FallbackProperties
Query the given list of configuration sets in order, returning the first defined value in one of them- Parameters:
configProperties-
-
FallbackProperties
A different way of passing the ordered list of configuration sets to look into- Parameters:
configProperties-
-
-
Method Details
-
addProvider
Append a provider to the fallback list (having thus the lowest priority)- Parameters:
config-
-
addProvider
Add another provider to the fallback list, either as the first element (with the highest priority) or as the last one (lowest priority).- Parameters:
config-first-truefor a high priority provider,falsefor a low priority one
-
removeProvider
Remove a provider from the fallback list- Parameters:
config-
-
gets
Description copied from class:ExtPropertiesGet the String value for a given key, returning the given default value if the key is not defined. The value that is returned is also stored in a cache so that future requests to the same key will return the value from the cache. This also means that if the key is not defined then the given default value will be cached and returned the next time this function is called.nullvalues are not cached.- Overrides:
getsin classExtProperties- Parameters:
sKey- the key to get the value forsDefault- default value to return in case the key is not defined.bProcessQueries- flag to process or not process the database/memory cache queries- Returns:
- value for this key
-
set
Description copied from class:ExtPropertiesModify an entry of the dictionary.- Overrides:
setin classExtProperties- Parameters:
sKey- key to changesValue- new value
-
isReadOnly
public boolean isReadOnly()Description copied from class:ExtPropertiesCheck if the configuration object is read only or can accept modifications to it- Overrides:
isReadOnlyin classExtProperties- Returns:
trueif changes are blocked
-
getProperties
Description copied from class:ExtPropertiesGet a Properties view of this object. This will force a parsing of all the defined keys.- Overrides:
getPropertiesin classExtProperties- Returns:
- a Properties view of this object
-