public class DeprecationUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
DeprecationUtils.EnvironmentVariableKey
Keywords for the environment variable
PW_DEPRECATED |
Modifier and Type | Field and Description |
---|---|
static String |
PW_DEPRECATED
Environment variable used to switch off deprecation phase implementation
|
Modifier and Type | Method and Description |
---|---|
static void |
clearEnv()
Sets the environment variable PW_DEPRECATED to an empty string, meaning
all flags corresponding to the deprecation phase will be active by default.
|
static void |
phase2(Class clazz,
String method,
String message)
According to the deprecation policy this method implements the phase 2 which
involves logging a warning and making a small pause in the execution thread.
|
static void |
phase3(Class clazz,
String method,
String message)
According to the deprecation policy this method implements the phase 3 which
involves throwing a runtime exception.
|
static void |
setEnv(DeprecationUtils.EnvironmentVariableKey... keys)
Helper hack to set the environment variable from Java.
|
public static final String PW_DEPRECATED
public static void phase2(Class clazz, String method, String message)
message
- the log messagepublic static void phase3(Class clazz, String method, String message)
message
- the log messagepublic static void setEnv(DeprecationUtils.EnvironmentVariableKey... keys)
For example if all keys are passed as parameter, this will set the environment variable PW_DEPRECATED=nolog,nodelay,noexception
keys
- the variables to set in the environment variablepublic static void clearEnv()
#setEnv(boolean, boolean, boolean)