jetbrains.buildServer.serverSide
Class TriggeredByBuilder

java.lang.Object
  extended by jetbrains.buildServer.serverSide.TriggeredByBuilder

public class TriggeredByBuilder
extends java.lang.Object

Builder which can be used to store some relevant information in triggered by field of a build. Information can be stored as a number of name = value pairs. The map of name = value pairs will then be provided to TriggeredByProcessor extension to convert to a text which should be shown in the UI. The builder is not thread safe.


Field Summary
static java.lang.String BUILD_TYPE_ID_PARAM_NAME
           
static java.lang.String IDE_PLUGIN_PARAM_NAME
           
static int MAX_LENGTH
           
static java.lang.String PARAMETERS_PREFIX
           
static java.lang.String RE_ADDED_AFTER_STOP_NAME
           
static java.lang.String SHOW_AS_IS
           
static java.lang.String USER_PARAM_NAME
           
static java.lang.String VCS_NAME_PARAM_NAME
           
 
Constructor Summary
TriggeredByBuilder()
          Use this constructor if build is not triggered by a user.
TriggeredByBuilder(User userWhoTriggeredBuild)
          Use this constructor if build is triggered manually by a user.
 
Method Summary
 void addParameter(java.lang.String paramName, java.lang.String paramValue)
          Adds new parameter to the map.
 void addParameters(java.util.Map<java.lang.String,java.lang.String> params)
          Adds new parameters to the map.
 void reset()
          Clears all added parameters.
 java.lang.String toString()
          Transforms map to a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MAX_LENGTH

public static final int MAX_LENGTH
See Also:
Constant Field Values

PARAMETERS_PREFIX

public static final java.lang.String PARAMETERS_PREFIX
See Also:
Constant Field Values

USER_PARAM_NAME

public static final java.lang.String USER_PARAM_NAME
See Also:
Constant Field Values

IDE_PLUGIN_PARAM_NAME

public static final java.lang.String IDE_PLUGIN_PARAM_NAME
See Also:
Constant Field Values

BUILD_TYPE_ID_PARAM_NAME

public static final java.lang.String BUILD_TYPE_ID_PARAM_NAME
See Also:
Constant Field Values

VCS_NAME_PARAM_NAME

public static final java.lang.String VCS_NAME_PARAM_NAME
See Also:
Constant Field Values

SHOW_AS_IS

public static final java.lang.String SHOW_AS_IS
See Also:
Constant Field Values

RE_ADDED_AFTER_STOP_NAME

public static final java.lang.String RE_ADDED_AFTER_STOP_NAME
See Also:
Constant Field Values
Constructor Detail

TriggeredByBuilder

public TriggeredByBuilder(@NotNull
                          User userWhoTriggeredBuild)
Use this constructor if build is triggered manually by a user.

Parameters:
userWhoTriggeredBuild - user triggered build

TriggeredByBuilder

public TriggeredByBuilder()
Use this constructor if build is not triggered by a user.

Method Detail

addParameter

public void addParameter(@NotNull
                         java.lang.String paramName,
                         @NotNull
                         java.lang.String paramValue)
                  throws java.lang.IllegalArgumentException
Adds new parameter to the map.

Parameters:
paramName - name of the parameter
paramValue - value of the parameter
Throws:
java.lang.IllegalArgumentException - in case if length of serialized map of parameters exceeds max length MAX_LENGTH

addParameters

public void addParameters(@NotNull
                          java.util.Map<java.lang.String,java.lang.String> params)
                   throws java.lang.IllegalArgumentException
Adds new parameters to the map.

Parameters:
params - parameters to add
Throws:
java.lang.IllegalArgumentException - in case if length of serialized map of parameters exceeds max length MAX_LENGTH

reset

public void reset()
Clears all added parameters.


toString

public java.lang.String toString()
Transforms map to a string. The order of parameters is preserved.

Overrides:
toString in class java.lang.Object
Returns:
see above