|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.github.fedorchuck.developers_notification.DevelopersNotificationUtil
public class DevelopersNotificationUtil
Class contains helper methods
Author: Volodymyr Fedorchuk
Constructor Summary | |
---|---|
DevelopersNotificationUtil()
|
Method Summary | |
---|---|
static java.lang.String |
arrayToString(java.lang.StackTraceElement[] stackTrace)
Convert array of StackTraceElement to string. |
static boolean |
checkTheNecessaryConfigurationExists(DevelopersNotificationMessenger messenger)
Check does the necessary messenger configuration exist |
static java.lang.String |
getEnvironmentVariable(java.lang.String key)
Getting environment variable value. |
static byte[] |
getThrowableStackTraceBytes(java.lang.Throwable throwable)
Convert Throwable stack trace to byte[] array |
static boolean |
isBlank(java.lang.String string)
Check is the given string is blank. |
static boolean |
isNullOrEmpty(java.lang.String string)
Check is the given string is null or is the empty string. |
static void |
printToLogEnvironmentVariable(java.lang.String name)
Prints environment variable value with. |
static void |
setEnvironmentVariable(java.lang.String key,
java.lang.String value)
Deprecated. |
static java.lang.String |
urlEncode(java.lang.String param)
Translates a string into application/x-www-form-urlencoded format using UTF-8 encoding scheme. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DevelopersNotificationUtil()
Method Detail |
---|
@Deprecated public static void setEnvironmentVariable(java.lang.String key, java.lang.String value)
NOTE:
System environment variables are accessible by any process.
Java system properties are only accessible by the process they are added to.
Probably, In your case should use Java system properties -
for it you can use, for example, System.setProperty(String, String)
key
- name of propertyvalue
- of property
java.lang.IllegalStateException
- if failed to set environment variablepublic static java.lang.String getEnvironmentVariable(java.lang.String key)
key
- name of property
public static void printToLogEnvironmentVariable(java.lang.String name)
DevelopersNotificationLogger.infoEnvironmentVariable(String, String)
.
name
- of propertypublic static java.lang.String urlEncode(java.lang.String param) throws java.io.UnsupportedEncodingException
param
- string to be translated
java.io.UnsupportedEncodingException
- - If the named encoding is not supportedpublic static java.lang.String arrayToString(java.lang.StackTraceElement[] stackTrace)
StackTraceElement
to string.
stackTrace
- - array of StackTraceElement
which will be converted
public static byte[] getThrowableStackTraceBytes(java.lang.Throwable throwable)
Throwable
stack trace to byte[] array
throwable
- - which will be converted
public static boolean isNullOrEmpty(java.lang.String string)
string
- to check
public static boolean isBlank(java.lang.String string)
isBlank(null): true; isBlank(""): true; isBlank(" "): true; isBlank("Hello world!"): false
string
- to check
public static boolean checkTheNecessaryConfigurationExists(DevelopersNotificationMessenger messenger)
messenger
- to check
true
if configuration exist;
false
otherwise.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |