Class DetachedMetadataContext
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<K,V>
java.util.LinkedHashMap<String,List<String>>
org.sdase.commons.server.dropwizard.metadata.DetachedMetadataContext
A
MetadataContext
representation which is detached from the current MetadataContext
. Changes in this class do not
propagate to the current MetadataContext
and vice
versa.
This variant of a MetadataContext
can be added to a business entity to persist the
context related to that entity in MongoDB with sda-commons-server-spring-data-mongo
. When
a process continues and the entity is loaded from MongoDB, the MetadataContext
can be
restored like this:
MetadataContext.createContext(detachedMetadataContextFromEntity)
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,
V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
static DetachedMetadataContext
of
(MetadataContext metadataContext) Methods inherited from class java.util.LinkedHashMap
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, removeEldestEntry, replaceAll, values
Methods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
-
Constructor Details
-
DetachedMetadataContext
public DetachedMetadataContext()
-
-
Method Details
-
of
- Parameters:
metadataContext
- the source metadata- Returns:
- a
DetachedMetadataContext
that provides the information of the givenmetadataContext
without affecting it on changes
-
toMetadataContext
- Returns:
- a
MetadataContext
to create a new context for the current thread
-
isEffectivelyEmpty
public boolean isEffectivelyEmpty()
-