public class Common extends Object
Constructor and Description |
---|
Common() |
Modifier and Type | Method and Description |
---|---|
static <T> ResponseData<T> |
buildErrorResponse(Exception e)
Builds error response from the given exception.
|
static boolean |
empty(String str)
Empty check for string.
|
static String |
getBuildNumber(PrintStream logger,
hudson.EnvVars envVars)
Returns build number from the given Environemnt Vars.
|
static String |
getJobName(hudson.EnvVars envVars) |
static Throwable |
getRootCause(Throwable throwable)
Returns actual Cause from the given exception.
|
static void |
log(PrintStream logger,
Object message)
Write a message to the given print stream.
|
static <T> ResponseData<T> |
parseResponse(retrofit2.Response<T> response)
Converts Retrofit's
Response to ResponseData |
static String |
sanitizeURL(String url)
Attaches the "/" at end of given url.
|
public static boolean empty(String str)
public static String sanitizeURL(String url)
url
- url as a string.public static void log(PrintStream logger, Object message)
logger
- PrintStream
message
- to log.public static String getJobName(hudson.EnvVars envVars)
public static String getBuildNumber(PrintStream logger, hudson.EnvVars envVars)
logger
- PrintStream
envVars
- EnvVars
public static <T> ResponseData<T> parseResponse(retrofit2.Response<T> response) throws IOException
Response
to ResponseData
response
- instance of Response
ResponseData
IOException
public static <T> ResponseData<T> buildErrorResponse(Exception e)
e
- instance of Exception
ResponseData
Copyright © 2016–2017 ThoughtsLive. All rights reserved.