Package fr.sandro642.github.misc
Class StoreAndRetrieve
java.lang.Object
fr.sandro642.github.misc.StoreAndRetrieve
StoreAndRetrieve is a utility class for storing and retrieving key-value pairs.
It provides methods to add, get, remove, and check for keys in a map.
* This class is used to manage configuration values such as the base URL of an API and file locations.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
containsKey
(String key) Check if the store contains a specific key.Retrieve a value associated with the specified key.void
Add a key-value pair to the store.void
Remove a key-value pair from the store.
-
Field Details
-
URL_KEY
URL_KEY is the key used to store the base URL of the API. FILE_LOCATION_KEY is the key used to store the file location for resources. store is a HashMap that holds key-value pairs for configuration settings.- See Also:
-
FILE_LOCATION_KEY
- See Also:
-
store
-
-
Constructor Details
-
StoreAndRetrieve
public StoreAndRetrieve()
-
-
Method Details
-
put
Add a key-value pair to the store.- Parameters:
key
- is the key under which the value will be stored.value
- is the value to be stored under the specified key.
-
get
Retrieve a value associated with the specified key.- Parameters:
key
- is the key for which the value will be retrieved.- Returns:
- the value associated with the specified key, or null if the key does not exist.
-
remove
Remove a key-value pair from the store.- Parameters:
key
- is the key of the entry to be removed.
-
containsKey
Check if the store contains a specific key.- Parameters:
key
- is the key to check for existence in the store.- Returns:
- true if the key exists, false otherwise.
-