Interface NamespaceStorage
- All Known Subinterfaces:
NamespaceStorage.GlobalStorage,OnDemandSchemaTreeStorage
public interface NamespaceStorage
A hierarchical entity storing a portion (or entirety) of a
ParserNamespace.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfacestatic enumEnumeration of all possible types of storage. -
Method Summary
Modifier and TypeMethodDescription<K,V> @Nullable Map<K, V> getAllFromLocalStorage(ParserNamespace<K, V> type) <K,V> @Nullable V getFromLocalStorage(ParserNamespace<K, V> type, K key) @Nullable NamespaceStorageReturn the parentNamespaceStorage.@NonNull NamespaceStorage.StorageTypeReturn the type of this storage.<K,V> @Nullable V putToLocalStorage(ParserNamespace<K, V> type, K key, V value) Populate specified namespace with a key/value pair, overwriting previous contents.<K,V> @Nullable V putToLocalStorageIfAbsent(ParserNamespace<K, V> type, K key, V value) Populate specified namespace with a key/value pair unless the key is already associated with a value.
-
Method Details
-
getStorageType
@NonNull NamespaceStorage.StorageType getStorageType()Return the type of this storage.- Returns:
- The type of this storage
-
getParentStorage
@Nullable NamespaceStorage getParentStorage()Return the parentNamespaceStorage. If this storage isNamespaceStorage.StorageType.GLOBAL, this method will returnnull.- Returns:
- Parent storage, if this is not the global storage
-
getFromLocalStorage
-
getAllFromLocalStorage
-
putToLocalStorage
Populate specified namespace with a key/value pair, overwriting previous contents. Similar toMap.put(Object, Object).- Type Parameters:
K- Namespace key typeV- Namespace value type- Parameters:
type- Namespace identifierkey- Keyvalue- Value- Returns:
- Previously-stored value, or null if the key was not present
-
putToLocalStorageIfAbsent
Populate specified namespace with a key/value pair unless the key is already associated with a value. Similar toMap.putIfAbsent(Object, Object).- Type Parameters:
K- Namespace key typeV- Namespace value type- Parameters:
type- Namespace identifierkey- Keyvalue- Value- Returns:
- Preexisting value or null if there was no previous mapping
-