public class Token extends JSONParsable
Constructor and Description |
---|
Token()
Empty Constructor
|
Token(javax.json.JsonObject jsonObject) |
Token(java.lang.String id,
java.lang.String label,
BTCPayServerFacade facade)
Constructor when creating a Token for fetching from BTC Pay SErver
|
Token(java.lang.String id,
java.lang.String token,
java.time.Instant expireDate,
BTCPayServerFacade facade)
Default constructor for a BTC Pay Server Token
|
Modifier and Type | Method and Description |
---|---|
void |
convertToJson(javax.json.JsonObjectBuilder jsonObjectBuilder)
Method that should set the objects property to Json representation.
|
boolean |
equals(java.lang.Object o) |
java.time.Instant |
getExpireDate() |
BTCPayServerFacade |
getFacade() |
java.lang.String |
getId() |
java.lang.String |
getLabel() |
java.lang.String |
getPairingCode() |
java.lang.String |
getToken()
Gets the BTC Pay Server token.
|
int |
hashCode() |
void |
parseJson(javax.json.JsonObject jsonObject)
Method to read all properties from a JsonObject into this value object.
|
void |
setExpireDate(java.time.Instant expireDate) |
void |
setFacade(BTCPayServerFacade facade) |
void |
setId(java.lang.String id) |
void |
setLabel(java.lang.String label) |
void |
setPairingCode(java.lang.String pairingCode) |
void |
setToken(java.lang.String token)
Sets the BTC Pay Server token.
|
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 Token(java.lang.String id, java.lang.String token, java.time.Instant expireDate, BTCPayServerFacade facade)
id
- the SIN value of the public keytoken
- the token valueexpireDate
- the expire instant of this token.facade
- the facade this token is valid for.public Token(java.lang.String id, java.lang.String label, BTCPayServerFacade facade)
id
- the SIN value of the public keylabel
- name of this requesting application.facade
- the facade this token is valid for.public Token(javax.json.JsonObject jsonObject)
public Token()
public java.lang.String getToken()
public void setToken(java.lang.String token)
token
- the BTC Pay Server token.public java.time.Instant getExpireDate()
public void setExpireDate(java.time.Instant expireDate)
expireDate
- the date this token expires.public BTCPayServerFacade getFacade()
public void setFacade(BTCPayServerFacade facade)
facade
- the facade that is used, merchant, pos etc.public java.lang.String getId()
public void setId(java.lang.String id)
id
- the id of the token, i.e the public key SINpublic java.lang.String getPairingCode()
public void setPairingCode(java.lang.String pairingCode)
pairingCode
- the pairing code retrieved from BTC Pay Serverpublic java.lang.String getLabel()
public void setLabel(java.lang.String label)
label
- the name of this requesting application.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 boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object