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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasMap()voidclear()protected ObjectentrySet()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) booleanisEmpty()keys()keySet()voidvoidvoidvoidputAll(String location, Properties properties) voidvoidputAll(OrderedLocationProperties other) intsize()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:
getPropertyin classProperties
-
getProperty
- Overrides:
getPropertyin classProperties
-
keys
- Overrides:
keysin classProperties
-
keySet
-
entrySet
-
size
public int size() -
stringPropertyNames
- Overrides:
stringPropertyNamesin classProperties
-
values
-
toString
- Overrides:
toStringin classProperties
-