public class SystemPropertiesExtensionsKt
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
withSystemProperties(kotlin.Pair<java.lang.String,java.lang.String> pair,
kotlin.jvm.functions.Function0<? extends T> block)
Overrides System Properties with chosen key and value
|
static <T> T |
withSystemProperties(java.util.Properties props,
kotlin.jvm.functions.Function0<? extends T> block)
Overrides System Properties with chosen properties
|
static <T> T |
withSystemProperties(java.util.Map<java.lang.String,java.lang.String> props,
kotlin.jvm.functions.Function0<? extends T> block)
Overrides System Properties with chosen keys and values
|
static <T> T |
withSystemProperty(java.lang.String key,
java.lang.String value,
kotlin.jvm.functions.Function0<? extends T> block)
Overrides System Properties with chosen key and value
|
public static <T> T withSystemProperty(java.lang.String key,
java.lang.String value,
kotlin.jvm.functions.Function0<? extends T> block)
Overrides System Properties with chosen key and value
This is a helper function for code that uses System Properties. It overrides the specific key from System.getProperties with the specified value, only during the execution of block.
If the chosen key is in the properties, it will be overridden. If the chosen key is not in the properties, it will be included.
After the execution of block, the properties are set to what they were before.
ATTENTION: This code is susceptible to race conditions. If you attempt to change the properties while it was already changed, the result is inconsistent, as the System Properties Map is a single map.
public static <T> T withSystemProperties(kotlin.Pair<java.lang.String,java.lang.String> pair,
kotlin.jvm.functions.Function0<? extends T> block)
Overrides System Properties with chosen key and value
This is a helper function for code that uses System Properties. It overrides the specific key from System.getProperties with the specified value, only during the execution of block.
If the chosen key is in the properties, it will be overridden. If the chosen key is not in the properties, it will be included.
After the execution of block, the properties are set to what they were before.
ATTENTION: This code is susceptible to race conditions. If you attempt to change the properties while it was already changed, the result is inconsistent, as the System Properties Map is a single map.
public static <T> T withSystemProperties(java.util.Properties props,
kotlin.jvm.functions.Function0<? extends T> block)
Overrides System Properties with chosen properties
This is a helper function for code that uses System Properties. It overrides the specific keys from System.getProperties with the specified values, only during the execution of block.
If the chosen key is in the properties, it will be overridden. If the chosen key is not in the properties, it will be included.
After the execution of block, the properties are set to what they were before.
ATTENTION: This code is susceptible to race conditions. If you attempt to change the properties while it was already changed, the result is inconsistent, as the System Properties Map is a single map.
public static <T> T withSystemProperties(java.util.Map<java.lang.String,java.lang.String> props,
kotlin.jvm.functions.Function0<? extends T> block)
Overrides System Properties with chosen keys and values
This is a helper function for code that uses System Properties. It overrides the specific key from System.getProperties with the specified value, only during the execution of block.
If the chosen key is in the properties, it will be overridden. If the chosen key is not in the properties, it will be included.
After the execution of block, the properties are set to what they were before.
ATTENTION: This code is susceptible to race conditions. If you attempt to change the properties while it was already changed, the result is inconsistent, as the System Properties Map is a single map.