public class RpcResult extends Object implements Result, Serializable
| 限定符和类型 | 方法和说明 |
|---|---|
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()
已过时。
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)
已过时。
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 在接口中 ResultgetValue()@Deprecated public void setResult(Object result)
setValue(Object)public void setValue(Object value)
public Throwable getException()
ResultgetException 在接口中 Resultpublic void setException(Throwable e)
public boolean hasException()
ResulthasException 在接口中 Resultpublic Map<String,String> getAttachments()
ResultgetAttachments 在接口中 Resultpublic void setAttachments(Map<String,String> map)
map - contains all key-value pairs to appendpublic String getAttachment(String key)
ResultgetAttachment 在接口中 Resultpublic String getAttachment(String key, String defaultValue)
ResultgetAttachment 在接口中 ResultCopyright © 2011–2018 The Apache Software Foundation. All rights reserved.