Package org.opendaylight.mdsal.dom.spi
Class DOMDataTreePrefixTable<V>
java.lang.Object
org.opendaylight.mdsal.dom.spi.DOMDataTreePrefixTable<V>
- Type Parameters:
V
- Value type
Prefix table indexed by
DOMDataTreeIdentifier
. Stores values in tree and provides lookup of closest ancestor.
This class is not thread-safe.-
Method Summary
Modifier and TypeMethodDescriptionstatic <V> DOMDataTreePrefixTable<V>
create()
@Nullable DOMDataTreePrefixTableEntry<V>
lookup
(@NonNull DOMDataTreeIdentifier prefix) Lookups entry by providedDOMDataTreeIdentifier
, if entry is not present returns closest non-null entry towards root or null if no entry towards root exists.void
remove
(@NonNull DOMDataTreeIdentifier prefix) Removes value associated to the prefix.void
store
(@NonNull DOMDataTreeIdentifier prefix, @NonNull V value) Stores value associated to the prefix.
-
Method Details
-
create
-
lookup
Lookups entry by providedDOMDataTreeIdentifier
, if entry is not present returns closest non-null entry towards root or null if no entry towards root exists.- Parameters:
prefix
- Prefix for lookup- Returns:
- closest non-null entry towards root or null if no entry towards root exists.
-
store
Stores value associated to the prefix.- Parameters:
prefix
- DOM prefix of valuevalue
- Value to be stored- Throws:
IllegalStateException
- If value is already stored for provided prefix
-
remove
Removes value associated to the prefix. Value is removed only and only if full prefix match for stored value. Removal of prefix does not remove child prefixes.- Parameters:
prefix
- to be removed
-