code
stringlengths
23
201k
docstring
stringlengths
17
96.2k
func_name
stringlengths
0
235
language
stringclasses
1 value
repo
stringlengths
8
72
path
stringlengths
11
317
url
stringlengths
57
377
license
stringclasses
7 values
public void info(String message, Object arg) { if (loggingService == null) { System.out.println(message); return; } loggingService.info(pluginId, loggerName, message, arg); }
Messages to be logged in info mode according to the specified format and argument. <p>This form avoids unnecessary object creation when the logger is disabled for the INFO level. </p> @param message the format string. @param arg the argument
info
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java
Apache-2.0
public void info(String message, Object arg1, Object arg2) { if (loggingService == null) { System.out.println(message); return; } loggingService.info(pluginId, loggerName, message, arg1, arg2); }
Messages to be logged in info mode according to the specified format and arguments. <p>This form avoids unnecessary object creation when the logger is disabled for the INFO level. </p> @param message the format string. @param arg1 the first argument @param arg2 the second argument
info
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java
Apache-2.0
public void info(String message, Object... arguments) { if (loggingService == null) { System.out.println(message); return; } loggingService.info(pluginId, loggerName, message, arguments); }
Messages to be logged in info mode according to the specified format and arguments. <p>This form avoids unnecessary object creation when the logger is disabled for the INFO level. </p> @param message the format string. @param arguments a list of 3 or more arguments
info
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java
Apache-2.0
public void warn(String message) { if (loggingService == null) { System.err.println(message); return; } loggingService.warn(pluginId, loggerName, message); }
Messages to be logged in warn mode. @param message a string containing the message to be logged.
warn
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java
Apache-2.0
public void warn(String message, Throwable throwable) { if (loggingService == null) { System.err.println(message); return; } loggingService.warn(pluginId, loggerName, message, throwable); }
Messages to be logged in warn mode. @param message a string containing the message to be logged. @param throwable error to be lgoged
warn
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java
Apache-2.0
public void warn(String message, Object arg) { if (loggingService == null) { System.out.println(message); return; } loggingService.warn(pluginId, loggerName, message, arg); }
Messages to be logged in warn mode according to the specified format and argument. <p>This form avoids unnecessary object creation when the logger is disabled for the WARN level. </p> @param message the format string. @param arg the argument
warn
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java
Apache-2.0
public void warn(String message, Object arg1, Object arg2) { if (loggingService == null) { System.out.println(message); return; } loggingService.warn(pluginId, loggerName, message, arg1, arg2); }
Messages to be logged in warn mode according to the specified format and arguments. <p>This form avoids unnecessary object creation when the logger is disabled for the WARN level. </p> @param message the format string. @param arg1 the first argument @param arg2 the second argument
warn
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java
Apache-2.0
public void warn(String message, Object... arguments) { if (loggingService == null) { System.out.println(message); return; } loggingService.warn(pluginId, loggerName, message, arguments); }
Messages to be logged in warn mode according to the specified format and arguments. <p>This form avoids unnecessary object creation when the logger is disabled for the WARN level. </p> @param message the format string. @param arguments a list of 3 or more arguments
warn
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java
Apache-2.0
public void error(String message) { if (loggingService == null) { System.err.println(message); return; } loggingService.error(pluginId, loggerName, message); }
Messages to be logged in error mode. @param message a string containing the message to be logged.
error
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java
Apache-2.0
public void error(String message, Throwable throwable) { if (loggingService == null) { System.err.println(message); return; } loggingService.error(pluginId, loggerName, message, throwable); }
Messages to be logged in error mode. @param message a string containing the message to be logged. @param throwable error to be lgoged
error
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java
Apache-2.0
public void error(String message, Object arg) { if (loggingService == null) { System.out.println(message); return; } loggingService.error(pluginId, loggerName, message, arg); }
Messages to be logged in error mode according to the specified format and argument. <p>This form avoids unnecessary object creation when the logger is disabled for the ERROR level. </p> @param message the format string. @param arg the argument
error
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java
Apache-2.0
public void error(String message, Object arg1, Object arg2) { if (loggingService == null) { System.out.println(message); return; } loggingService.error(pluginId, loggerName, message, arg1, arg2); }
Messages to be logged in error mode according to the specified format and arguments. <p>This form avoids unnecessary object creation when the logger is disabled for the ERROR level. </p> @param message the format string. @param arg1 the first argument @param arg2 the second argument
error
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java
Apache-2.0
public void error(String message, Object... arguments) { if (loggingService == null) { System.out.println(message); return; } loggingService.error(pluginId, loggerName, message, arguments); }
Messages to be logged in error mode according to the specified format and arguments. <p>This form avoids unnecessary object creation when the logger is disabled for the ERROR level. </p> @param message the format string. @param arguments a list of 3 or more arguments
error
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java
Apache-2.0
private static Object getPluginIdStaticFieldFrom(Class<?> kls) { try { Field field = kls.getDeclaredField("pluginId"); field.setAccessible(true); return field.get(null); } catch (Exception e) { throw new RuntimeException(e); } }
Messages to be logged in error mode according to the specified format and arguments. <p>This form avoids unnecessary object creation when the logger is disabled for the ERROR level. </p> @param message the format string. @param arguments a list of 3 or more arguments
getPluginIdStaticFieldFrom
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java
Apache-2.0
public void setRequestBody(String requestBody) { this.requestBody = requestBody; }
Sets request body @param requestBody Json formatted request body represented as string
setRequestBody
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/request/DefaultGoApiRequest.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/request/DefaultGoApiRequest.java
Apache-2.0
public void addRequestParameter(String name, String value) { requestParameters.put(name, value); }
Adds new request parameter. Replace existing parameter with same name @param name Name of the parameter @param value Value of the parameter
addRequestParameter
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/request/DefaultGoApiRequest.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/request/DefaultGoApiRequest.java
Apache-2.0
public void addRequestHeader(String name, String value) { requestHeaders.put(name, value); }
Adds new request header. Replace existing header with same name @param name Name of the header @param value Value of the header
addRequestHeader
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/request/DefaultGoApiRequest.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/request/DefaultGoApiRequest.java
Apache-2.0
@Override public String api() { return api; }
Api name for the request @return api name
api
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/request/DefaultGoApiRequest.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/request/DefaultGoApiRequest.java
Apache-2.0
@Override public String apiVersion() { return apiVersion; }
Api version of the request @return api version
apiVersion
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/request/DefaultGoApiRequest.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/request/DefaultGoApiRequest.java
Apache-2.0
@Override public GoPluginIdentifier pluginIdentifier() { return pluginIdentifier; }
Provides an instance of GoPluginIdentifier for the request @return an instance of GoPluginIdentifier
pluginIdentifier
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/request/DefaultGoApiRequest.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/request/DefaultGoApiRequest.java
Apache-2.0
@Override public Map<String, String> requestParameters() { return requestParameters; }
Provides request parameters as key value pair for the request @return request parameters as a Map
requestParameters
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/request/DefaultGoApiRequest.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/request/DefaultGoApiRequest.java
Apache-2.0
@Override public Map<String, String> requestHeaders() { return requestHeaders; }
Provides request headers as key value pair for the request. Request headers can be used to send any meta information related to request @return request headers as a Map
requestHeaders
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/request/DefaultGoApiRequest.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/request/DefaultGoApiRequest.java
Apache-2.0
@Override public String requestBody() { return requestBody; }
Provides json formatted request body @return request body
requestBody
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/request/DefaultGoApiRequest.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/request/DefaultGoApiRequest.java
Apache-2.0
public void setRequestBody(String requestBody) { this.requestBody = requestBody; }
Sets request body @param requestBody Json formatted request body represented as string
setRequestBody
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/request/DefaultGoPluginApiRequest.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/request/DefaultGoPluginApiRequest.java
Apache-2.0
public void addRequestParameter(String name, String value) { requestParameters.put(name, value); }
Adds new request parameter. Replace existing parameter with same name @param name Name of the parameter @param value Value of the parameter
addRequestParameter
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/request/DefaultGoPluginApiRequest.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/request/DefaultGoPluginApiRequest.java
Apache-2.0
public void addRequestHeader(String name, String value) { requestHeaders.put(name, value); }
Adds new request header. Replace existing header with same name @param name Name of the header @param value Value of the header
addRequestHeader
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/request/DefaultGoPluginApiRequest.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/request/DefaultGoPluginApiRequest.java
Apache-2.0
@Override public String extension() { return extension; }
Extension name of the request @return extension name
extension
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/request/DefaultGoPluginApiRequest.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/request/DefaultGoPluginApiRequest.java
Apache-2.0
@Override public String extensionVersion() { return extensionVersion; }
Extension version of the request @return extension version
extensionVersion
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/request/DefaultGoPluginApiRequest.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/request/DefaultGoPluginApiRequest.java
Apache-2.0
@Override public String requestName() { return requestName; }
Name or operation supported for an extension @return name of the request
requestName
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/request/DefaultGoPluginApiRequest.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/request/DefaultGoPluginApiRequest.java
Apache-2.0
@Override public Map<String, String> requestParameters() { return unmodifiableMap(requestParameters); }
Provides request parameters as key value pair for the request @return map of request parameters
requestParameters
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/request/DefaultGoPluginApiRequest.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/request/DefaultGoPluginApiRequest.java
Apache-2.0
@Override public Map<String, String> requestHeaders() { return unmodifiableMap(requestHeaders); }
Provides request headers as key value pair for the request. Request headers can be used to send any meta information related to request @return map of request headers
requestHeaders
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/request/DefaultGoPluginApiRequest.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/request/DefaultGoPluginApiRequest.java
Apache-2.0
@Override public String requestBody() { return requestBody; }
Provides json formatted request body of request @return Request body
requestBody
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/request/DefaultGoPluginApiRequest.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/request/DefaultGoPluginApiRequest.java
Apache-2.0
public void setRequestParams(Map<String, String> params) { if (params != null) { this.requestParameters = params; } }
Provides json formatted request body of request @return Request body
setRequestParams
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/request/DefaultGoPluginApiRequest.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/request/DefaultGoPluginApiRequest.java
Apache-2.0
public void setRequestHeaders(Map<String, String> headers) { if (headers != null) { this.requestHeaders = headers; } }
Provides json formatted request body of request @return Request body
setRequestHeaders
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/request/DefaultGoPluginApiRequest.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/request/DefaultGoPluginApiRequest.java
Apache-2.0
public static DefaultGoApiResponse incompleteRequest(String responseBody) { DefaultGoApiResponse defaultGoApiResponse = new DefaultGoApiResponse(412); defaultGoApiResponse.setResponseBody(responseBody); return defaultGoApiResponse; }
Creates an instance DefaultGoApiResponse which represents incomplete request with response code 412 @param responseBody Response body @return an instance of DefaultGoApiResponse
incompleteRequest
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/response/DefaultGoApiResponse.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/response/DefaultGoApiResponse.java
Apache-2.0
public static DefaultGoApiResponse badRequest(String responseBody) { DefaultGoApiResponse defaultGoApiResponse = new DefaultGoApiResponse(400); defaultGoApiResponse.setResponseBody(responseBody); return defaultGoApiResponse; }
Creates an instance DefaultGoApiResponse which represents bad request with response code 400 @param responseBody Response body @return an instance of DefaultGoApiResponse
badRequest
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/response/DefaultGoApiResponse.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/response/DefaultGoApiResponse.java
Apache-2.0
public static DefaultGoApiResponse error(String responseBody) { DefaultGoApiResponse defaultGoApiResponse = new DefaultGoApiResponse(500); defaultGoApiResponse.setResponseBody(responseBody); return defaultGoApiResponse; }
Creates an instance DefaultGoApiResponse which represents error request with response code 500 @param responseBody Response body @return an instance of DefaultGoApiResponse
error
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/response/DefaultGoApiResponse.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/response/DefaultGoApiResponse.java
Apache-2.0
public static DefaultGoApiResponse success(String responseBody) { DefaultGoApiResponse defaultGoApiResponse = new DefaultGoApiResponse(SUCCESS_RESPONSE_CODE); defaultGoApiResponse.setResponseBody(responseBody); return defaultGoApiResponse; }
Creates an instance DefaultGoApiResponse which represents success request with response code 200 @param responseBody Json formatted response body @return an instance of DefaultGoApiResponse
success
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/response/DefaultGoApiResponse.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/response/DefaultGoApiResponse.java
Apache-2.0
public void addResponseHeader(String name, String value) { responseHeaders.put(name, value); }
Adds new response header. Replace existing header with same name @param name Name of the header @param value Value of the header
addResponseHeader
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/response/DefaultGoApiResponse.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/response/DefaultGoApiResponse.java
Apache-2.0
public void setResponseBody(String responseBody) { this.responseBody = responseBody; }
Sets response body @param responseBody Json formatted response body represented as string
setResponseBody
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/response/DefaultGoApiResponse.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/response/DefaultGoApiResponse.java
Apache-2.0
@Override public int responseCode() { return responseCode; }
Provides response code for the request sent @return
responseCode
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/response/DefaultGoApiResponse.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/response/DefaultGoApiResponse.java
Apache-2.0
@Override public Map<String, String> responseHeaders() { return unmodifiableMap(responseHeaders); }
Provides response headers as key value pair for the response. Response headers can be used to send any meta information related to response @return request headers as a Map
responseHeaders
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/response/DefaultGoApiResponse.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/response/DefaultGoApiResponse.java
Apache-2.0
@Override public String responseBody() { return responseBody; }
Provides json formatted response body @return response body
responseBody
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/response/DefaultGoApiResponse.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/response/DefaultGoApiResponse.java
Apache-2.0
public static DefaultGoPluginApiResponse incompleteRequest(String responseBody) { return new DefaultGoPluginApiResponse(VALIDATION_FAILED, responseBody); }
Creates an instance DefaultGoPluginApiResponse which represents incomplete request with response code 412 @param responseBody Response body @return an instance of DefaultGoPluginApiResponse
incompleteRequest
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/response/DefaultGoPluginApiResponse.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/response/DefaultGoPluginApiResponse.java
Apache-2.0
public static DefaultGoPluginApiResponse badRequest(String responseBody) { return new DefaultGoPluginApiResponse(BAD_REQUEST, responseBody); }
Creates an instance DefaultGoPluginApiResponse which represents bad request with response code 400 @param responseBody Response body @return an instance of DefaultGoPluginApiResponse
badRequest
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/response/DefaultGoPluginApiResponse.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/response/DefaultGoPluginApiResponse.java
Apache-2.0
public static DefaultGoPluginApiResponse error(String responseBody) { return new DefaultGoPluginApiResponse(INTERNAL_ERROR, responseBody); }
Creates an instance DefaultGoPluginApiResponse which represents error request with response code 500 @param responseBody Response body @return an instance of DefaultGoPluginApiResponse
error
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/response/DefaultGoPluginApiResponse.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/response/DefaultGoPluginApiResponse.java
Apache-2.0
public static DefaultGoPluginApiResponse success(String responseBody) { return new DefaultGoPluginApiResponse(SUCCESS_RESPONSE_CODE, responseBody); }
Creates an instance DefaultGoPluginApiResponse which represents success request with response code 200 @param responseBody Json formatted response body @return an instance of DefaultGoPluginApiResponse
success
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/response/DefaultGoPluginApiResponse.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/response/DefaultGoPluginApiResponse.java
Apache-2.0
public void addResponseHeader(String name, String value) { responseHeaders.put(name, value); }
Adds new response header. Replace existing header with same name @param name Name of the header @param value Value of the header
addResponseHeader
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/response/DefaultGoPluginApiResponse.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/response/DefaultGoPluginApiResponse.java
Apache-2.0
public void setResponseBody(String responseBody) { this.responseBody = responseBody; }
Sets response body @param responseBody Json formatted response body represented as string
setResponseBody
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/response/DefaultGoPluginApiResponse.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/response/DefaultGoPluginApiResponse.java
Apache-2.0
@Override public int responseCode() { return responseCode; }
Provides response code for the request sent @return
responseCode
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/response/DefaultGoPluginApiResponse.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/response/DefaultGoPluginApiResponse.java
Apache-2.0
@Override public Map<String, String> responseHeaders() { return responseHeaders; }
Provides response headers as key value pair for the response. Response headers can be used to send any meta information related to response @return request headers as a Map
responseHeaders
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/response/DefaultGoPluginApiResponse.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/response/DefaultGoPluginApiResponse.java
Apache-2.0
@Override public String responseBody() { return responseBody; }
Provides json formatted response body @return response body
responseBody
java
gocd/gocd
plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/response/DefaultGoPluginApiResponse.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/response/DefaultGoPluginApiResponse.java
Apache-2.0
public Property get(String key) { for (Property property : properties) { if (property.getKey().equals(key)) { return property; } } return null; }
Gets property for a given property key @param key the key whose associated property to be returned @return the property to which the specified key is mapped, or null if this property with given key not found
get
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/config/Configuration.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/config/Configuration.java
Apache-2.0
public int size() { return properties.size(); }
Returns number of properties in this configuration @return number of properties in this configuration
size
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/config/Configuration.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/config/Configuration.java
Apache-2.0
public List<? extends Property> list() { return properties; }
Returns copy of properties list @return copy of properties list
list
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/config/Configuration.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/config/Configuration.java
Apache-2.0
public void setValue(T value) { this.value = value; }
Sets the value for this option @param value the value to be set for this option
setValue
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/config/Option.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/config/Option.java
Apache-2.0
public T getValue() { return value; }
Gets value for this option @return value for this option
getValue
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/config/Option.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/config/Option.java
Apache-2.0
public Option<T> copy() { return new Option<>(name, value); }
Creates copy of this option @return copy of this option
copy
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/config/Option.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/config/Option.java
Apache-2.0
public <T> boolean hasSameNameAs(Option<T> option) { return name.equals(option.name); }
Checks if this option has same name as the provided option @param <T> type for the option value @param option the option for which name equality has to be checked @return true if name matches
hasSameNameAs
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/config/Option.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/config/Option.java
Apache-2.0
@SuppressWarnings("unchecked") public <T> Option<T> findOption(Option<T> option) { for (Option<T> candidateOption : options) { if (candidateOption.hasSameNameAs(option)) { return candidateOption; } } throw new RuntimeException("You tried to set an unex...
Finds matching option by option name @param option the option used for matching @param <T> the type of the option @return matched option @throws RuntimeException when matching option not found
findOption
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/config/Options.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/config/Options.java
Apache-2.0
public <T> boolean hasOption(Option<T> option) { for (Option<?> candidateOption : options) { if (candidateOption.hasSameNameAs(option)) { return true; } } return false; }
Finds matching option by option name @param option the option used for matching @param <T> the type of the option @return matched option @throws RuntimeException when matching option not found
hasOption
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/config/Options.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/config/Options.java
Apache-2.0
public <T> void addOrSet(Option<T> option, T value) { if (!hasOption(option)) { add(option); } set(option, value); }
Finds matching option by option name @param option the option used for matching @param <T> the type of the option @return matched option @throws RuntimeException when matching option not found
addOrSet
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/config/Options.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/config/Options.java
Apache-2.0
public int size() { return options.size(); }
Finds matching option by option name @param option the option used for matching @param <T> the type of the option @return matched option @throws RuntimeException when matching option not found
size
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/config/Options.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/config/Options.java
Apache-2.0
public String getKey() { return key; }
Gets property key @return property key
getKey
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/config/Property.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/config/Property.java
Apache-2.0
final public <T> Property with(Option<T> option, T value) { if(value != null){ options.addOrSet(option, value); } return this; }
Adds an option @param option Option type to be added @param value Option value @param <T> Type of option value @return current property instance (this)
with
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/config/Property.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/config/Property.java
Apache-2.0
public String getValue() { return value == null ? defaultValue : value; }
Gets property value. @return property value
getValue
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/config/Property.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/config/Property.java
Apache-2.0
public <T> T getOption(Option<T> option) { return options.findOption(option).getValue(); }
Gets value for given option @param option for which value needs to fetched @param <T> type of option @return option value
getOption
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/config/Property.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/config/Property.java
Apache-2.0
public Options getOptions() { return options; }
Gets all options of property @return all options of property
getOptions
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/config/Property.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/config/Property.java
Apache-2.0
public Property withDefault(String defaultValue) { this.defaultValue = defaultValue; return this; }
Gets all options of property @return all options of property
withDefault
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/config/Property.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/config/Property.java
Apache-2.0
@Override public List<? extends Property> list() { List<? extends Property> list = super.list(); list.sort(null); return list; }
Represents {@link Configuration} specific to package
list
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/material/packagerepository/PackageConfiguration.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/material/packagerepository/PackageConfiguration.java
Apache-2.0
private void validateDataKeys(Map<String, String> data) { if (data != null) { for (String key : data.keySet()) { validateDataKey(key); } } }
Represents specific revision of the package. Package revision consists of revision, timestamp, user, revision comment and addition data. Additional data is key vale map. Each entry added to additional data will be provided to agent as environment variable.
validateDataKeys
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/material/packagerepository/PackageRevision.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/material/packagerepository/PackageRevision.java
Apache-2.0
public String getRevision() { return revision; }
Gets revision string @return revision string
getRevision
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/material/packagerepository/PackageRevision.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/material/packagerepository/PackageRevision.java
Apache-2.0
public Date getTimestamp() { return timestamp; }
Gets revision timestamp @return revision timestamp
getTimestamp
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/material/packagerepository/PackageRevision.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/material/packagerepository/PackageRevision.java
Apache-2.0
public String getUser() { return user; }
Gets user associated with revision @return user associated with revision
getUser
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/material/packagerepository/PackageRevision.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/material/packagerepository/PackageRevision.java
Apache-2.0
public String getRevisionComment() { return revisionComment; }
Gets comment associated with revision @return comment associated with revision
getRevisionComment
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/material/packagerepository/PackageRevision.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/material/packagerepository/PackageRevision.java
Apache-2.0
public String getTrackbackUrl() { return trackbackUrl; }
Gets url which can provide information about producer of package revision @return url which can provide information about producer of package revision
getTrackbackUrl
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/material/packagerepository/PackageRevision.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/material/packagerepository/PackageRevision.java
Apache-2.0
public Map<String, String> getData() { return data; }
Gets additional data related to package revision @return additional data related to package revision
getData
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/material/packagerepository/PackageRevision.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/material/packagerepository/PackageRevision.java
Apache-2.0
public String getDataFor(String key) { return data.get(key); }
Gets additional data related to package revision for given key @param key for additional data @return additional data related to package revision for given key
getDataFor
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/material/packagerepository/PackageRevision.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/material/packagerepository/PackageRevision.java
Apache-2.0
public void addData(String key, String value) throws InvalidPackageRevisionDataException { validateDataKey(key); data.put(key, value); }
Adds additional data related to the package revision @param key for additional data @param value for additional data @throws InvalidPackageRevisionDataException if the key is null or empty
addData
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/material/packagerepository/PackageRevision.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/material/packagerepository/PackageRevision.java
Apache-2.0
public void validateDataKey(String key) throws InvalidPackageRevisionDataException { if (key == null || key.isEmpty()) { throw new InvalidPackageRevisionDataException(DATA_KEY_EMPTY_MESSAGE); } Matcher matcher = DATA_KEY_PATTERN.matcher(key); if (!matcher.matches()) { ...
Adds additional data related to the package revision @param key for additional data @param value for additional data @throws InvalidPackageRevisionDataException if the key is null or empty
validateDataKey
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/material/packagerepository/PackageRevision.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/material/packagerepository/PackageRevision.java
Apache-2.0
private String dataKeyInvalidMessage(String key) { return String.format("Key '%s' is invalid. Key names should consists of only alphanumeric characters and/or underscores.", key); }
Adds additional data related to the package revision @param key for additional data @param value for additional data @throws InvalidPackageRevisionDataException if the key is null or empty
dataKeyInvalidMessage
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/material/packagerepository/PackageRevision.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/material/packagerepository/PackageRevision.java
Apache-2.0
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } PackageRevision that = (PackageRevision) o; if (revision != null ? !revision.equals(that.revision) : th...
Adds additional data related to the package revision @param key for additional data @param value for additional data @throws InvalidPackageRevisionDataException if the key is null or empty
equals
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/material/packagerepository/PackageRevision.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/material/packagerepository/PackageRevision.java
Apache-2.0
@Override public int hashCode() { int result = revision != null ? revision.hashCode() : 0; result = 31 * result + (timestamp != null ? timestamp.hashCode() : 0); result = 31 * result + (user != null ? user.hashCode() : 0); return result; }
Adds additional data related to the package revision @param key for additional data @param value for additional data @throws InvalidPackageRevisionDataException if the key is null or empty
hashCode
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/material/packagerepository/PackageRevision.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/material/packagerepository/PackageRevision.java
Apache-2.0
@Override public String toString() { return "PackageRevision{" + "revision='" + revision + '\'' + ", timestamp=" + timestamp + ", user='" + user + '\'' + ", revisionComment='" + revisionComment + '\'' + ", trackbackUrl='" + trac...
Adds additional data related to the package revision @param key for additional data @param value for additional data @throws InvalidPackageRevisionDataException if the key is null or empty
toString
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/material/packagerepository/PackageRevision.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/material/packagerepository/PackageRevision.java
Apache-2.0
@Override public List<? extends Property> list() { List<? extends Property> list = super.list(); list.sort(null); return list; }
Represents {@link Configuration} specific to repository
list
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/material/packagerepository/RepositoryConfiguration.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/material/packagerepository/RepositoryConfiguration.java
Apache-2.0
public boolean isSuccessful() { return Status.SUCCESS == status; }
Checks if result is successful @return true if result successful
isSuccessful
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/response/Result.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/response/Result.java
Apache-2.0
public List<String> getMessages() { return messages; }
Gets error messages associated with result @return error messages associated with result
getMessages
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/response/Result.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/response/Result.java
Apache-2.0
public Result withErrorMessages(String... errors) { return withErrorMessages(Arrays.asList(errors)); }
Creates instance of result with specified errors @param errors the errors with which instance should be created @return created instance
withErrorMessages
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/response/Result.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/response/Result.java
Apache-2.0
public Result withErrorMessages(List<String> errorList) { return withStatusAndMessages(Status.FAILURE, errorList); }
Creates instance of result with specified errors @param errorList the errors with which instance should be created @return created instance
withErrorMessages
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/response/Result.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/response/Result.java
Apache-2.0
public Result withSuccessMessages(String... successMessages) { List<String> msgList = Arrays.asList(successMessages); return withSuccessMessages(msgList); }
Creates instance of result with specified success messages @param successMessages the success messages with which instance should be created @return created instance
withSuccessMessages
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/response/Result.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/response/Result.java
Apache-2.0
public Result withSuccessMessages(List<String> successMessages) { return withStatusAndMessages(Status.SUCCESS, successMessages); }
Creates instance of result with specified success messages @param successMessages the success messages with which instance should be created @return created instance
withSuccessMessages
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/response/Result.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/response/Result.java
Apache-2.0
private Result withStatusAndMessages(Status status, List<String> messages) { this.status = status; this.messages.addAll(messages); return this; }
Creates instance of result with specified success messages @param successMessages the success messages with which instance should be created @return created instance
withStatusAndMessages
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/response/Result.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/response/Result.java
Apache-2.0
public String getMessagesForDisplay() { if(messages.isEmpty()) { return ""; } StringBuilder stringBuilder = new StringBuilder(); for (String message : messages) { stringBuilder.append(message); stringBuilder.append("\n"); } String tempS...
Formats the messages in the result to a suitable form so that it can be used in user interface. @return a string containing the formatted message.
getMessagesForDisplay
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/response/Result.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/response/Result.java
Apache-2.0
public static ExecutionResult failure(String message, Exception exception) { return failure(message); }
Mark the result as 'Failure'. @param message More details about the failure. @param exception (currently not used) @return A new ExecutionResult instance, which is marked as 'Failure'.
failure
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/response/execution/ExecutionResult.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/response/execution/ExecutionResult.java
Apache-2.0
public static ExecutionResult failure(String message) { ExecutionResult executionResult = new ExecutionResult(); executionResult.withErrorMessages(message); return executionResult; }
Mark the result as 'Failure'. @param message More details about the failure. @return A new ExecutionResult instance, which is marked as 'Failure'.
failure
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/response/execution/ExecutionResult.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/response/execution/ExecutionResult.java
Apache-2.0
public static ExecutionResult success(String message) { ExecutionResult executionResult = new ExecutionResult(); executionResult.withSuccessMessages(message); return executionResult; }
Mark the result as 'Success'. @param message More details about the run. @return A new ExecutionResult instance, which is marked as 'Success'.
success
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/response/execution/ExecutionResult.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/response/execution/ExecutionResult.java
Apache-2.0
public String getKey() { return key; }
Gets error key @return error key
getKey
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/response/validation/ValidationError.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/response/validation/ValidationError.java
Apache-2.0
public String getMessage() { return message; }
Gets error message @return error message
getMessage
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/response/validation/ValidationError.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/response/validation/ValidationError.java
Apache-2.0
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ValidationError validationError = (ValidationError) o; if (key != null ? !key.equals(validationError.ke...
Gets error message @return error message
equals
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/response/validation/ValidationError.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/response/validation/ValidationError.java
Apache-2.0
@Override public int hashCode() { int result = key != null ? key.hashCode() : 0; result = 31 * result + (message != null ? message.hashCode() : 0); return result; }
Gets error message @return error message
hashCode
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/response/validation/ValidationError.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/response/validation/ValidationError.java
Apache-2.0