public class MinimalInvoice extends JWTClaim implements Payment
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLAIM_NAME |
protected byte[] |
preImageHash |
Constructor and Description |
---|
MinimalInvoice()
Empty Constructor
|
MinimalInvoice(Invoice invoice)
Default constructor, from existing invoice
|
MinimalInvoice(javax.json.JsonObject jsonObject)
JSON Parseable constructor
|
MinimalInvoice(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() |
byte[] |
getPreImageHash() |
void |
parseJson(javax.json.JsonObject jsonObject)
Method to read all properties from a JsonObject into this value object.
|
void |
setPreImageHash(byte[] preImageHash) |
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
public MinimalInvoice()
public MinimalInvoice(Invoice invoice)
invoice
- the invoice to create a minimal invoice from.public MinimalInvoice(javax.json.JsonObject jsonObject) throws javax.json.JsonException
jsonObject
- the json object to parsejavax.json.JsonException
public MinimalInvoice(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 which acts as an unique id for the payment.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