public class Status extends Object
Status
indicating either OK
or KO. Optionally, it can also provide additional data.Constructor and Description |
---|
Status()
Creates a new instance of
Status with default values. |
Status(JsonObject json)
Creates a new instance of
Status from the given JSON structure. |
Status(Status other)
|
Modifier and Type | Method and Description |
---|---|
JsonObject |
getData() |
boolean |
isOk() |
boolean |
isProcedureInError() |
static Status |
KO()
Creates a status when something bad is detected.
|
static Status |
KO(JsonObject data)
Creates a status when something bad is detected.
|
static Status |
OK()
Creates a status when everything is fine.
|
static Status |
OK(JsonObject data)
Creates a status when everything is fine and adds metadata.
|
Status |
setData(JsonObject data)
Sets the metadata.
|
Status |
setKO()
Sets the outcome of the status to KO.
|
Status |
setOK()
Sets the outcome of the status to OK.
|
Status |
setOk(boolean ok)
Sets whether or not the current status is positive (UP) or negative (DOWN).
|
Status |
setProcedureInError(boolean procedureInError)
Sets whether or not the procedure attached to this status has failed (timeout, error...).
|
JsonObject |
toJson()
Builds the JSON representation of the current
Status instance. |
public Status()
Status
with default values.public Status(Status other)
other
- the status to copy, must not be null
public Status(JsonObject json)
Status
from the given JSON structure.json
- the serialized form, must not be null
public static Status OK(JsonObject data)
Status
public static Status KO()
Status
public static Status KO(JsonObject data)
Status
public JsonObject toJson()
Status
instance.public boolean isOk()
public Status setOk(boolean ok)
ok
- true
for UP, false
for DOWNpublic Status setKO()
public Status setOK()
public JsonObject getData()
public Status setData(JsonObject data)
data
- the datapublic boolean isProcedureInError()
public Status setProcedureInError(boolean procedureInError)
procedureInError
- true
if the procedure has not been completed correctly.Copyright © 2024 Eclipse. All rights reserved.