| 构造器和说明 |
|---|
Status() |
Status(int code,
String errorMsg) |
Status(int code,
String fmt,
Object... args) |
Status(RaftError raftError,
String fmt,
Object... args) |
Status(Status s) |
| 限定符和类型 | 方法和说明 |
|---|---|
Status |
copy()
Copy current object(deep-clone).
|
boolean |
equals(Object obj) |
int |
getCode()
Get error code.
|
String |
getErrorMsg()
Get the error msg.
|
RaftError |
getRaftError()
Get raft error from error code.
|
int |
hashCode() |
boolean |
isOk()
Returns true when status is in OK state.
|
static Status |
OK()
Creates a OK status instance.
|
void |
reset()
Reset status to be OK state.
|
void |
setCode(int code)
Set error code.
|
void |
setError(int code,
String fmt,
Object... args)
Set error code and error msg.
|
void |
setError(RaftError error,
String fmt,
Object... args)
Set raft error and error msg.
|
void |
setErrorMsg(String errMsg)
Set error msg
|
String |
toString() |
public Status()
public Status(Status s)
public Status(int code,
String errorMsg)
public static Status OK()
public void reset()
public boolean isOk()
public void setCode(int code)
public int getCode()
public RaftError getRaftError()
public void setErrorMsg(String errMsg)
public void setError(RaftError error, String fmt, Object... args)
public String getErrorMsg()
Copyright © 2021. All rights reserved.