Package org.ldk.structs
Class PaymentPurpose
- java.lang.Object
-
- org.ldk.structs.PaymentPurpose
-
- Direct Known Subclasses:
PaymentPurpose.InvoicePayment
,PaymentPurpose.SpontaneousPayment
public class PaymentPurpose extends Object
Some information provided on receipt of payment depends on whether the payment received is a spontaneous payment or a \"conventional\" lightning payment that's paying an invoice.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PaymentPurpose.InvoicePayment
Information for receiving a payment that we generated an invoice for.static class
PaymentPurpose.SpontaneousPayment
Because this is a spontaneous payment, the payer generated their own preimage rather than us (the payee) providing a preimage.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PaymentPurpose
clone()
Creates a copy of the PaymentPurposeboolean
eq(PaymentPurpose b)
Checks if two PaymentPurposes contain equal inner contents.boolean
equals(Object o)
protected void
finalize()
static PaymentPurpose
invoice_payment(byte[] payment_preimage, byte[] payment_secret)
Utility method to constructs a new InvoicePayment-variant PaymentPurposestatic Result_PaymentPurposeDecodeErrorZ
read(byte[] ser)
Read a PaymentPurpose from a byte array, created by PaymentPurpose_writestatic PaymentPurpose
spontaneous_payment(byte[] a)
Utility method to constructs a new SpontaneousPayment-variant PaymentPurposebyte[]
write()
Serialize the PaymentPurpose object into a byte array which can be read by PaymentPurpose_read
-
-
-
Method Detail
-
finalize
protected void finalize() throws Throwable
-
clone
public PaymentPurpose clone()
Creates a copy of the PaymentPurpose
-
invoice_payment
public static PaymentPurpose invoice_payment(byte[] payment_preimage, byte[] payment_secret)
Utility method to constructs a new InvoicePayment-variant PaymentPurpose
-
spontaneous_payment
public static PaymentPurpose spontaneous_payment(byte[] a)
Utility method to constructs a new SpontaneousPayment-variant PaymentPurpose
-
eq
public boolean eq(PaymentPurpose b)
Checks if two PaymentPurposes contain equal inner contents. This ignores pointers and is_owned flags and looks at the values in fields.
-
write
public byte[] write()
Serialize the PaymentPurpose object into a byte array which can be read by PaymentPurpose_read
-
read
public static Result_PaymentPurposeDecodeErrorZ read(byte[] ser)
Read a PaymentPurpose from a byte array, created by PaymentPurpose_write
-
-