|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthudson.plugins.im.tools.MessageHelper
public class MessageHelper
Utility class to help message creation
| Constructor Summary | |
|---|---|
MessageHelper()
|
|
| Method Summary | ||
|---|---|---|
static
|
concat(T[] array1,
T[]... arrays)
Returns a new array which a concatenation of the argument arrays. |
|
static
|
copyOf(T[] original,
int newLength)
Copies the specified array, truncating or padding with nulls (if necessary) so the copy has the specified length. |
|
static
|
copyOfRange(T[] original,
int from,
int to)
Copies the specified range of the specified array into a new array. |
|
static java.lang.String[] |
extractCommandLine(java.lang.String message)
Parses a bot command from a given string. |
|
static java.lang.String |
getBuildURL(hudson.model.AbstractBuild<?,?> build)
Returns the full URL to the build details page for a given build. |
|
static java.lang.String |
getJoinedName(java.lang.String[] args,
int startIndex)
Extracts a name from an argument array starting at a start index and removing quoting ". |
|
static java.lang.String |
getTestUrl(hudson.tasks.junit.TestObject result)
Returns the full URL to the test details page for a given test result; |
|
static java.lang.String |
join(java.lang.String[] array,
int startIndex)
Joins together all strings in the array - starting at startIndex - by using a single space as separator. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MessageHelper()
| Method Detail |
|---|
public static java.lang.String getBuildURL(hudson.model.AbstractBuild<?,?> build)
public static java.lang.String getTestUrl(hudson.tasks.junit.TestObject result)
public static java.lang.String[] extractCommandLine(java.lang.String message)
public static <T> T[] copyOfRange(T[] original,
int from,
int to)
original - the array from which a range is to be copiedfrom - the initial index of the range to be copied, inclusiveto - the final index of the range to be copied, exclusive.
(This index may lie outside the array.)
java.lang.ArrayIndexOutOfBoundsException - if from < 0
or from > original.length()
java.lang.IllegalArgumentException - if from > to
java.lang.NullPointerException - if original is null
Note: Unfortunately in Java 5 there is no Arrays#copyOfRange, yet.
So we have to implement it ourself.
public static <T> T[] copyOf(T[] original,
int newLength)
original - the array to be copiednewLength - the length of the copy to be returned
java.lang.NegativeArraySizeException - if newLength is negative
java.lang.NullPointerException - if original is null
Note: copied from java 6
public static <T> T[] concat(T[] array1,
T[]... arrays)
public static java.lang.String join(java.lang.String[] array,
int startIndex)
public static java.lang.String getJoinedName(java.lang.String[] args,
int startIndex)
args - the argumentsstartIndex - the start index
java.lang.IndexOutOfBoundsException - if startIndex > args length
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||