public class LightningEvent extends JSONParsable
Modifier and Type | Field and Description |
---|---|
protected LightningHandlerContext |
context |
protected Invoice |
invoice |
protected LightningEventType |
type |
Constructor and Description |
---|
LightningEvent()
Empty constructor
|
LightningEvent(javax.json.JsonObject jsonObject)
JSON Parseable constructor
|
LightningEvent(LightningEventType type,
Invoice invoice,
LightningHandlerContext context)
Default constructor
|
Modifier and Type | Method and Description |
---|---|
void |
convertToJson(javax.json.JsonObjectBuilder jsonObjectBuilder)
Method that should set the objects property to Json representation.
|
LightningHandlerContext |
getContext() |
Invoice |
getInvoice() |
LightningEventType |
getType() |
void |
parseJson(javax.json.JsonObject jsonObject)
Method to read all properties from a JsonObject into this value object.
|
void |
setContext(LightningHandlerContext context) |
void |
setInvoice(Invoice invoice) |
void |
setType(LightningEventType type) |
add, addB58, addNotRequired, addNotRequiredB58, getBoolean, getBooleanIfSet, getByteArrayFromB58, getByteArrayFromB58IfSet, getByteArrayFromB64, getByteArrayFromB64IfSet, getByteArrayFromHex, getByteArrayFromHexIfSet, getDate, getDateIfSet, getDouble, getDoubleIfSet, getInt, getIntIfSet, getJsonArray, getJsonArrayIfSet, getJsonObject, getJsonObjectIfSet, getLong, getLongIfSet, getString, getStringIfSet, toJson, toJsonAsString, toString
protected LightningEventType type
protected Invoice invoice
protected LightningHandlerContext context
public LightningEvent()
public LightningEvent(LightningEventType type, Invoice invoice, LightningHandlerContext context)
type
- the type of event, added or settled.invoice
- the related invoicecontext
- the latest context if the lightning handler.public LightningEvent(javax.json.JsonObject jsonObject) throws javax.json.JsonException
jsonObject
- the json object to parse.javax.json.JsonException
public LightningEventType getType()
public void setType(LightningEventType type)
type
- the type of event, added or settled.public Invoice getInvoice()
public void setInvoice(Invoice invoice)
invoice
- the related invoicepublic LightningHandlerContext getContext()
public void setContext(LightningHandlerContext context)
context
- the latest context of the used lightning handler that
contains the latest known state.public void convertToJson(javax.json.JsonObjectBuilder jsonObjectBuilder) throws javax.json.JsonException
convertToJson
in class JSONParsable
jsonObjectBuilder
- the json object build to use to set key/values in jsonjavax.json.JsonException
- if problems occurred converting object to JSON.public void parseJson(javax.json.JsonObject jsonObject) throws javax.json.JsonException
parseJson
in class JSONParsable
jsonObject
- the json object to read key and values from and set object properties.javax.json.JsonException
- if problems occurred converting object from JSON.