Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLAIM_NAME |
protected Invoice |
invoice |
protected boolean |
payPerRequest |
protected byte[] |
preImageHash |
protected java.time.Instant |
validFrom |
protected java.time.Instant |
validUntil |
Constructor and Description |
---|
Settlement()
Empty Constructor
|
Settlement(byte[] preImageHash,
Invoice invoice,
java.time.Instant validUntil,
java.time.Instant validFrom,
boolean payPerRequest)
Default Constructor
|
Settlement(javax.json.JsonObject jsonObject)
JSON Parseable constructor
|
Settlement(org.jose4j.jwt.JwtClaims jwtClaims)
Parse from JWTClaims constructor
|
Modifier and Type | Method and Description |
---|---|
void |
convertToJson(javax.json.JsonObjectBuilder jsonObjectBuilder)
Method that should set the objects property to Json representation.
|
java.lang.String |
getClaimName() |
Invoice |
getInvoice() |
byte[] |
getPreImageHash() |
java.time.Instant |
getValidFrom() |
java.time.Instant |
getValidUntil() |
boolean |
isPayPerRequest() |
void |
minimizeData()
Method that minimizes the amount of data (by removing the related invoice) if
the settlement data is only needed to verify if a given preImageHash have been
settled or not.
|
void |
parseJson(javax.json.JsonObject jsonObject)
Method to read all properties from a JsonObject into this value object.
|
void |
setInvoice(Invoice invoice) |
void |
setPayPerRequest(boolean payPerRequest) |
void |
setPreImageHash(byte[] preImageHash) |
void |
setValidFrom(java.time.Instant validFrom) |
void |
setValidUntil(java.time.Instant validUntil) |
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
public static final java.lang.String CLAIM_NAME
protected byte[] preImageHash
protected Invoice invoice
protected java.time.Instant validUntil
protected java.time.Instant validFrom
protected boolean payPerRequest
public Settlement()
public Settlement(byte[] preImageHash, Invoice invoice, java.time.Instant validUntil, java.time.Instant validFrom, boolean payPerRequest)
preImageHash
- the generated preImageHash from PreImageData and used as primary key for the payment request.invoice
- the related invoice. (Optional)validUntil
- the time the payment is valid and the requested call can used.validFrom
- the time the payment is valid from. (Optional)payPerRequest
- if the settlement is one time only, i.e only valid for one request.public Settlement(javax.json.JsonObject jsonObject) throws javax.json.JsonException
jsonObject
- the json object to parsejavax.json.JsonException
public Settlement(org.jose4j.jwt.JwtClaims jwtClaims)
jwtClaims
- the JWT Tokens Claim set to extract data from.public byte[] getPreImageHash()
getPreImageHash
in interface Payment
public void setPreImageHash(byte[] preImageHash)
preImageHash
- the generated preImageHash from PreImageData and used as primary key for the payment request.public Invoice getInvoice()
public void setInvoice(Invoice invoice)
invoice
- the related invoice. (Optional)public java.time.Instant getValidUntil()
public void setValidUntil(java.time.Instant validUntil)
validUntil
- the time the payment is valid and the requested call can used.public java.time.Instant getValidFrom()
public void setValidFrom(java.time.Instant validFrom)
validFrom
- the time the payment is valid from. (Optional)public boolean isPayPerRequest()
public void setPayPerRequest(boolean payPerRequest)
payPerRequest
- if the settlement is one time only, i.e only valid for one request.public void minimizeData()
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.public java.lang.String getClaimName()
getClaimName
in class JWTClaim