hudson.plugins.jabber.tools
Class MessageHelper

java.lang.Object
  extended by hudson.plugins.jabber.tools.MessageHelper

public class MessageHelper
extends java.lang.Object

Utility class to help message creation

Author:
vsellier

Constructor Summary
MessageHelper()
           
 
Method Summary
static
<T,U> T[]
copyOfRange(U[] original, int from, int to, java.lang.Class<? extends T[]> newType)
          Unfortunately in Java 5 there is no Arrays.copyOfRange.
static java.lang.String[] extractCommandLine(java.lang.String message)
           
static java.lang.String getBuildURL(hudson.model.AbstractBuild<?,?> lastBuild)
           
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 ".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageHelper

public MessageHelper()
Method Detail

getBuildURL

public static java.lang.String getBuildURL(hudson.model.AbstractBuild<?,?> lastBuild)

extractCommandLine

public static java.lang.String[] extractCommandLine(java.lang.String message)

copyOfRange

public static <T,U> T[] copyOfRange(U[] original,
                                    int from,
                                    int to,
                                    java.lang.Class<? extends T[]> newType)
Unfortunately in Java 5 there is no Arrays.copyOfRange. So we have to implement it ourself.


getJoinedName

public 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 ".

Parameters:
args - the arguments
startIndex - the start index
Returns:
the job name as a single String
Throws:
java.lang.IndexOutOfBoundsException - if startIndex > args length


Copyright © 2009. All Rights Reserved.