Class ExtEnvUtils
java.lang.Object
fr.inria.rules.integraal.api.external.ExtEnvUtils
Deprecated.
Utility methods for manipulating externally visible environment registries.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> booleanDeprecated.Checks if a specified key exists in the given map.static <T> TDeprecated.Removes the key-value pair associated with the specified key from the map.static <T> TDeprecated.Retrieves the value associated with the specified key from the given map.Deprecated.Lists all the keys in the given map.static <T> StringDeprecated.Generates a new name with the given prefix that does not already exist in the map.static <T> TDeprecated.Renames a key in the map to a new name.static <T> TDeprecated.Replaces the value associated with the specified key in the map.static <T> TDeprecated.Stores a new key-value pair in the map if the key does not already exist.
-
Method Details
-
list
-
contains
Deprecated.Checks if a specified key exists in the given map.- Type Parameters:
T- The type of values in the map.- Parameters:
map- The map in which to check the key.name- The key to check for.- Returns:
- True if the key exists in the map, otherwise false.
-
getByName
Deprecated.Retrieves the value associated with the specified key from the given map.- Type Parameters:
T- The type of values in the map.- Parameters:
map- The map from which to get the value.name- The key whose associated value is to be returned.- Returns:
- The value associated with the specified key, or null if the key is not found.
-
newName
Deprecated.Generates a new name with the given prefix that does not already exist in the map.- Type Parameters:
T- The type of values in the map.- Parameters:
map- The map against which uniqueness is checked.prefix- The prefix to use for the generated name.- Returns:
- A new unique name.
- Throws:
IllegalStateException- If a unique name could not be generated after several attempts.
-
store
Deprecated.Stores a new key-value pair in the map if the key does not already exist.- Type Parameters:
T- The type of values in the map.- Parameters:
map- The map in which to store the key-value pair.name- The key to store.container- The value to associate with the key.- Returns:
- The previous value associated with the key, or null if there was no previous value.
- Throws:
IllegalStateException- If the key already exists in the map.
-
replace
Deprecated.Replaces the value associated with the specified key in the map.- Type Parameters:
T- The type of values in the map.- Parameters:
map- The map in which to replace the value.name- The key whose value is to be replaced.container- The new value to associate with the key.- Returns:
- The previous value associated with the key, or null if there was no previous value.
-
discard
Deprecated.Removes the key-value pair associated with the specified key from the map.- Type Parameters:
T- The type of values in the map.- Parameters:
map- The map from which to remove the key-value pair.name- The key whose associated key-value pair is to be removed.- Returns:
- The value that was associated with the key, or null if the key was not found.
- Throws:
NoSuchElementException- If the key does not exist in the map.
-
rename
public static <T> T rename(Map<String, T> map, String oldName, String newName) throws IllegalStateException, NoSuchElementExceptionDeprecated.Renames a key in the map to a new name.- Type Parameters:
T- The type of values in the map.- Parameters:
map- The map in which to rename the key.oldName- The old key name.newName- The new key name.- Returns:
- The value associated with the new key name.
- Throws:
IllegalStateException- If the new key already exists in the map.NoSuchElementException- If the old key does not exist in the map.
-