public class ServiceResult extends Object implements Serializable
| Constructor and Description |
|---|
ServiceResult() |
ServiceResult(ServiceResultState state) |
ServiceResult(ServiceResultState state,
String message) |
ServiceResult(ServiceResultState state,
String message,
Throwable throwable) |
| Modifier and Type | Method and Description |
|---|---|
static ServiceResult |
error(String error) |
static ServiceResult |
failed(String error,
Throwable t) |
String |
getMessage() |
Throwable |
getRootCause() |
String |
getRootMessage() |
ServiceResultState |
getState() |
Throwable |
getThrowable() |
boolean |
isNok() |
boolean |
isOk() |
void |
setMessage(String message) |
void |
setState(ServiceResultState state) |
void |
setThrowable(Throwable throwable) |
static ServiceResult |
success() |
static ServiceResult |
success(String msg) |
static ServiceResult |
warning(String warning) |
static ServiceResult |
warning(String warning,
Throwable t) |
public ServiceResult()
public ServiceResult(ServiceResultState state)
state - public ServiceResult(ServiceResultState state, String message)
state - message - public ServiceResult(ServiceResultState state, String message, Throwable throwable)
state - message - throwable - public boolean isOk()
ServiceResultState.SUCCESSpublic boolean isNok()
ServiceResultState.SUCCESSpublic ServiceResultState getState()
public void setState(ServiceResultState state)
state - the state to setpublic String getMessage()
public void setMessage(String message)
message - the message to setpublic String getRootMessage()
public Throwable getRootCause()
public Throwable getThrowable()
public void setThrowable(Throwable throwable)
throwable - the throwable to setpublic static ServiceResult success()
public static ServiceResult success(String msg)
public static ServiceResult warning(String warning)
public static ServiceResult warning(String warning, Throwable t)
public static ServiceResult error(String error)
public static ServiceResult failed(String error, Throwable t)
Copyright © 2011–2016 Strolch. All rights reserved.