refactor all class to use the message key for sending messages.

This commit is contained in:
DNx5
2015-11-26 10:18:53 +07:00
parent 2de0e0e819
commit 7a78b321e7
31 changed files with 197 additions and 133 deletions
@@ -89,6 +89,31 @@ public class StringUtils {
return sb.toString();
}
/**
* Joins a list of elements into a single string with the specified delimiter.
*
* @param delimiter the delimiter to use
* @param elements the elements to join
*
* @return a new String that is composed of the elements separated by the delimiter
*/
public static String join(CharSequence delimiter, CharSequence... elements) {
if (elements.length == 0) {
return "";
}
if (delimiter == null) {
delimiter = "";
}
StringBuilder sb = new StringBuilder(elements[0]);
if (elements.length > 1) {
for (int i = 1; i < elements.length; i++) {
sb.append(delimiter);
sb.append(elements[i]);
}
}
return sb.toString();
}
/**
* Get a full stack trace of an exception as a string.
*
@@ -107,6 +132,7 @@ public class StringUtils {
// Return the result as a string
return stringWriter.toString();
}
/**
* Format the information from a Throwable as string, retaining the type and its message.
*