Class MergedProperties
java.lang.Object
org.apache.sis.internal.util.AbstractMap<String,Object>
org.apache.sis.internal.referencing.MergedProperties
A map which first looks for values in a user supplied map, then looks in a default map if no value where found
in the user supplied one. This map is for
GeodeticObjectFactory
and
other SIS factories internal usage only.- Since:
- 0.6
- Version:
- 0.6
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sis.internal.util.AbstractMap
AbstractMap.EntryIterator<K,
V>, AbstractMap.IteratorAdapter<K, V>, AbstractMap.KeyIterator -
Field Summary
FieldsModifier and TypeFieldDescriptionFallback for values not found inproperties
.A map containing the merge of user and default properties, ornull
if not yet created.The user supplied properties. -
Constructor Summary
ConstructorsConstructorDescriptionMergedProperties
(Map<String, ?> properties, Map<String, ?> defaultProperties) Creates a new map which will merge the given properties on the fly. -
Method Summary
Modifier and TypeMethodDescriptionprotected AbstractMap.EntryIterator
<String, Object> Returns an iterator over the user supplied properties together with the default properties which were not specified in the user's ones.Returns the value for the given key by first looking in the user supplied map, then by looking in the default properties if no value were specified in the user map.protected Object
invisibleEntry
(Object key) Returns the value for an "invisible" entry if no user supplied values were found for that key.Methods inherited from class org.apache.sis.internal.util.AbstractMap
addKey, addValue, clear, containsKey, containsValue, entrySet, equals, getOrDefault, hashCode, isEmpty, keySet, put, putAll, remove, size, toString, values
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
properties
The user supplied properties. -
defaultProperties
Fallback for values not found inproperties
. -
merge
A map containing the merge of user and default properties, ornull
if not yet created. This map is normally never needed. It may be created only if the user creates his own subclass ofGeodeticObjectFactory
or other factories and iterates on this map or asks for its size.
-
-
Constructor Details
-
MergedProperties
Creates a new map which will merge the given properties on the fly.- Parameters:
properties
- the user supplied properties.defaultProperties
- fallback for values not found inproperties
.
-
-
Method Details
-
entryIterator
Returns an iterator over the user supplied properties together with the default properties which were not specified in the user's ones.- Specified by:
entryIterator
in classAbstractMap<String,
Object> - Returns:
- iterator over merged properties.
-
get
Returns the value for the given key by first looking in the user supplied map, then by looking in the default properties if no value were specified in the user map. If there is no default value, invokesinvisibleEntry(Object)
in last resort.- Parameters:
key
- the key for which to get the value.- Returns:
- the value associated to the given key, or
null
if none.
-
invisibleEntry
Returns the value for an "invisible" entry if no user supplied values were found for that key. This is used only for "secret" keys used for SIS internal purpose (not for public API).Example:GeodeticObjectFactory
handles the"mtFactory"
key in a special way since this is normally not needed for CRS, CS and datum objects, except when creating the SIS implementation of derived or projected CRS (because of the way we implemented derived CRS). But this is somewhat specific to SIS, so we do no want to expose this implementation details.- Parameters:
key
- the key for which to get the value.- Returns:
- the value associated to the given key, or
null
if none.
-