java.lang.Object
com.github.cyanbaz.jenkins.plugins.jsonparameter.JsonResult<T>
Type Parameters:
T - The type of the value.

public class JsonResult<T> extends Object
A generic result container used to wrap the outcome of loading JSON data. Includes a success flag, the result value (if successful), and an optional error message.
Author:
Caner Yanbaz
  • Constructor Details

    • JsonResult

      public JsonResult(boolean success, T value, String errorMessage)
  • Method Details

    • isSuccess

      public boolean isSuccess()
    • getValue

      public T getValue()
    • getErrorMessage

      public String getErrorMessage()
    • success

      public static <T> JsonResult<T> success(T value)
    • failure

      public static <T> JsonResult<T> failure(String errorMessage)