public class RpcResult extends Object implements Result, Serializable
| Constructor and Description |
|---|
RpcResult() |
RpcResult(Object result) |
RpcResult(Throwable exception) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAttachments(Map<String,String> map) |
String |
getAttachment(String key)
get attachment by key.
|
String |
getAttachment(String key,
String defaultValue)
get attachment by key with default value.
|
Map<String,String> |
getAttachments()
get attachments.
|
Throwable |
getException()
Get exception.
|
Object |
getResult()
Deprecated.
Replace to getValue()
|
Object |
getValue()
Get invoke result.
|
boolean |
hasException()
Has exception.
|
Object |
recreate()
Recreate.
|
void |
setAttachment(String key,
String value) |
void |
setAttachments(Map<String,String> map)
Append all items from the map into the attachment, if map is empty then nothing happens
|
void |
setException(Throwable e) |
void |
setResult(Object result)
Deprecated.
Replace to setValue()
|
void |
setValue(Object value) |
String |
toString() |
public RpcResult()
public RpcResult(Object result)
public RpcResult(Throwable exception)
public Object recreate() throws Throwable
Result
if (hasException()) {
throw getException();
} else {
return getValue();
}
@Deprecated public Object getResult()
getResult in interface ResultgetValue()@Deprecated public void setResult(Object result)
setValue(Object)public void setValue(Object value)
public Throwable getException()
ResultgetException in interface Resultpublic void setException(Throwable e)
public boolean hasException()
ResulthasException in interface Resultpublic Map<String,String> getAttachments()
ResultgetAttachments in interface Resultpublic void setAttachments(Map<String,String> map)
map - contains all key-value pairs to appendpublic String getAttachment(String key)
ResultgetAttachment in interface Resultpublic String getAttachment(String key, String defaultValue)
ResultgetAttachment in interface ResultCopyright © 2011–2020 The Apache Software Foundation. All rights reserved.