public class Order extends JWTClaim implements Payment
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLAIM_NAME |
protected java.lang.String |
description |
protected java.time.Instant |
expireDate |
protected Amount |
orderAmount |
protected byte[] |
preImageHash |
Constructor and Description |
---|
Order()
Empty Constructor
|
Order(byte[] preImageHash,
java.lang.String description,
Amount orderAmount,
java.time.Instant expireDate)
Default Constructor.
|
Order(javax.json.JsonObject jsonObject)
JSON Parseable constructor
|
Order(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() |
java.lang.String |
getDescription() |
java.time.Instant |
getExpireDate() |
Amount |
getOrderAmount() |
byte[] |
getPreImageHash() |
void |
parseJson(javax.json.JsonObject jsonObject)
Method to read all properties from a JsonObject into this value object.
|
void |
setDescription(java.lang.String description) |
void |
setExpireDate(java.time.Instant expireDate) |
void |
setOrderAmount(Amount orderAmount) |
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
protected java.lang.String description
protected Amount orderAmount
protected java.time.Instant expireDate
public Order()
public Order(byte[] preImageHash, java.lang.String description, Amount orderAmount, java.time.Instant expireDate)
preImageHash
- the generated preImageHash from PreImageData.description
- description to display in the invoice. (Optional).orderAmount
- the amount to create invoice for before eventual currency convertion. (Required)expireDate
- the time when the payment should be considered expired and not accepted. (Required)public Order(javax.json.JsonObject jsonObject) throws javax.json.JsonException
jsonObject
- the json object to parsejavax.json.JsonException
public Order(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.public java.lang.String getDescription()
public void setDescription(java.lang.String description)
description
- description to display in the invoice. (Optional).public Amount getOrderAmount()
public void setOrderAmount(Amount orderAmount)
orderAmount
- the amount to create invoice for before eventual currency convertion. (Required)public java.time.Instant getExpireDate()
public void setExpireDate(java.time.Instant expireDate)
expireDate
- the time when the payment should be considered expired and not accepted. (Required)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