Update auto-generated bindings to latest upstream
[ldk-java] / src / main / java / org / ldk / structs / Invoice.java
index 695f35decfced543f1bb30630408d6fd80eb7016..452fbb0a4b60e6e1ef3045c2347daf0509770061 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -39,6 +40,7 @@ public class Invoice extends CommonBase {
         */
        public Invoice clone() {
                long ret = bindings.Invoice_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Invoice ret_hu_conv = new Invoice(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -49,6 +51,7 @@ public class Invoice extends CommonBase {
         */
        public SignedRawInvoice into_signed_raw() {
                long ret = bindings.Invoice_into_signed_raw(this.ptr);
+               if (ret < 1024) { return null; }
                SignedRawInvoice ret_hu_conv = new SignedRawInvoice(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                this.ptrs_to.add(this);
@@ -60,6 +63,7 @@ public class Invoice extends CommonBase {
         */
        public Result_NoneSemanticErrorZ check_signature() {
                long ret = bindings.Invoice_check_signature(this.ptr);
+               if (ret < 1024) { return null; }
                Result_NoneSemanticErrorZ ret_hu_conv = Result_NoneSemanticErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -81,6 +85,7 @@ public class Invoice extends CommonBase {
         */
        public static Result_InvoiceSemanticErrorZ from_signed(SignedRawInvoice signed_invoice) {
                long ret = bindings.Invoice_from_signed(signed_invoice == null ? 0 : signed_invoice.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_InvoiceSemanticErrorZ ret_hu_conv = Result_InvoiceSemanticErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(signed_invoice);
                return ret_hu_conv;
@@ -104,7 +109,10 @@ public class Invoice extends CommonBase {
 
        /**
         * Get the payee's public key if one was included in the invoice
+        * 
+        * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
+       @Nullable
        public byte[] payee_pub_key() {
                byte[] ret = bindings.Invoice_payee_pub_key(this.ptr);
                return ret;
@@ -112,7 +120,10 @@ public class Invoice extends CommonBase {
 
        /**
         * Get the payment secret if one was included in the invoice
+        * 
+        * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
+       @Nullable
        public byte[] payment_secret() {
                byte[] ret = bindings.Invoice_payment_secret(this.ptr);
                return ret;
@@ -120,9 +131,13 @@ public class Invoice extends CommonBase {
 
        /**
         * Get the invoice features if they were included in the invoice
+        * 
+        * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
+       @Nullable
        public InvoiceFeatures features() {
                long ret = bindings.Invoice_features(this.ptr);
+               if (ret < 1024) { return null; }
                InvoiceFeatures ret_hu_conv = new InvoiceFeatures(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -196,6 +211,7 @@ public class Invoice extends CommonBase {
         */
        public Option_u64Z amount_pico_btc() {
                long ret = bindings.Invoice_amount_pico_btc(this.ptr);
+               if (ret < 1024) { return null; }
                Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -204,8 +220,9 @@ public class Invoice extends CommonBase {
        /**
         * Read a Invoice object from a string
         */
-       public static Result_InvoiceNoneZ from_str(String s) {
+       public static Result_InvoiceNoneZ from_str(java.lang.String s) {
                long ret = bindings.Invoice_from_str(s);
+               if (ret < 1024) { return null; }
                Result_InvoiceNoneZ ret_hu_conv = Result_InvoiceNoneZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }