All Downloads are FREE. Search and download functionalities are using the official Maven repository.
Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
io.cloudslang.content.xml.utils.ResultUtils Maven / Gradle / Ivy
package io.cloudslang.content.xml.utils;
import io.cloudslang.content.xml.entities.Constants;
import java.util.Map;
/**
* Created by markowis on 03/03/2016.
*/
public class ResultUtils {
private ResultUtils() {}
public static void populateFailureResult(Map result, String errorMessage) {
populateResult(result, Constants.FAILURE, Constants.EMPTY_STRING, Constants.EMPTY_STRING, Constants.Outputs.RESULT_XML, Constants.ReturnCodes.FAILURE, errorMessage);
}
public static void populateSuccessResult(Map result, String returnResult, String resultXml) {
populateResult(result, Constants.SUCCESS, returnResult, resultXml, Constants.Outputs.RESULT_XML, Constants.ReturnCodes.SUCCESS, Constants.EMPTY_STRING);
}
public static void populateValueResult(Map result, String resultText, String returnResult, String selectedValue, String returnCode) {
populateResult(result, resultText, returnResult, selectedValue, Constants.Outputs.SELECTED_VALUE, returnCode, Constants.EMPTY_STRING);
}
private static void populateResult(Map result, String resultText,
String returnResult, String resultXml, String resultKey, String returnCode, String errorMessage) {
result.put(Constants.Outputs.RESULT_TEXT, resultText);
result.put(Constants.Outputs.RETURN_RESULT, returnResult);
result.put(Constants.Outputs.RETURN_CODE, returnCode);
result.put(Constants.Outputs.ERROR_MESSAGE, errorMessage);
result.put(resultKey, resultXml);
}
}