Package org.apache.camel.util
Class OrderedLocationProperties
java.lang.Object
java.util.Dictionary<K,V>
java.util.Hashtable<Object,Object>
java.util.Properties
org.apache.camel.util.OrderedLocationProperties
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<Object,
Object>
An
OrderedProperties
that also keeps track from which location the properties are sourced from, and default
values.
This can be used to track all the various sources for configuration that a Camel application uses (properties file,
ENV variables, hardcoded in java, spring-boot, quarkus, camel-k modeline, camel-yaml-dsl etc.
Important: Use the put method that takes location as argument to store location information, and the put
method that takes default value as argument to store default value information.- See Also:
-
Field Summary
Fields inherited from class java.util.Properties
defaults
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionasMap()
void
clear()
protected Object
entrySet()
getDefaultValue
(Object key) Gets the default value of the property, if a default value existsgetLocation
(Object key) Gets the location from where the property was resolvedgetProperty
(String key) getProperty
(String key, String defaultValue) boolean
isEmpty()
keys()
keySet()
void
void
void
void
putAll
(String location, Properties properties) void
void
putAll
(OrderedLocationProperties other) int
size()
toString()
values()
Methods inherited from class java.util.Properties
clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, equals, forEach, getOrDefault, hashCode, list, list, load, load, loadFromXML, merge, propertyNames, putIfAbsent, rehash, remove, replace, replace, replaceAll, save, setProperty, store, store, storeToXML, storeToXML, storeToXML
-
Constructor Details
-
OrderedLocationProperties
public OrderedLocationProperties()
-
-
Method Details
-
put
-
put
-
putAll
-
putAll
-
putAll
-
getLocation
Gets the location from where the property was resolved- Parameters:
key
- the property key- Returns:
- the location, or null if not possible to determine the location.
-
getDefaultValue
Gets the default value of the property, if a default value exists- Parameters:
key
- the property key- Returns:
- the default value, or null if not possible to determine the default value.
-
clear
-
remove
-
asMap
-
put
-
doPut
-
putAll
-
get
-
isEmpty
public boolean isEmpty() -
getProperty
- Overrides:
getProperty
in classProperties
-
getProperty
- Overrides:
getProperty
in classProperties
-
keys
- Overrides:
keys
in classProperties
-
keySet
-
entrySet
-
size
public int size() -
stringPropertyNames
- Overrides:
stringPropertyNames
in classProperties
-
values
-
toString
- Overrides:
toString
in classProperties
-