[Java] Update auto-generated bindings to LDK 0.0.123
[ldk-java] / src / main / java / org / ldk / structs / UnknownPaymentContext.java
1 package org.ldk.structs;
2
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
5 import org.ldk.util.*;
6 import java.util.Arrays;
7 import java.lang.ref.Reference;
8 import javax.annotation.Nullable;
9
10
11 /**
12  * An unknown payment context.
13  */
14 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
15 public class UnknownPaymentContext extends CommonBase {
16         UnknownPaymentContext(Object _dummy, long ptr) { super(ptr); }
17         @Override @SuppressWarnings("deprecation")
18         protected void finalize() throws Throwable {
19                 super.finalize();
20                 if (ptr != 0) { bindings.UnknownPaymentContext_free(ptr); }
21         }
22
23         long clone_ptr() {
24                 long ret = bindings.UnknownPaymentContext_clone_ptr(this.ptr);
25                 Reference.reachabilityFence(this);
26                 return ret;
27         }
28
29         /**
30          * Creates a copy of the UnknownPaymentContext
31          */
32         public UnknownPaymentContext clone() {
33                 long ret = bindings.UnknownPaymentContext_clone(this.ptr);
34                 Reference.reachabilityFence(this);
35                 if (ret >= 0 && ret <= 4096) { return null; }
36                 org.ldk.structs.UnknownPaymentContext ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UnknownPaymentContext(null, ret); }
37                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
38                 return ret_hu_conv;
39         }
40
41         /**
42          * Checks if two UnknownPaymentContexts contain equal inner contents.
43          * This ignores pointers and is_owned flags and looks at the values in fields.
44          * Two objects with NULL inner values will be considered "equal" here.
45          */
46         public boolean eq(org.ldk.structs.UnknownPaymentContext b) {
47                 boolean ret = bindings.UnknownPaymentContext_eq(this.ptr, b.ptr);
48                 Reference.reachabilityFence(this);
49                 Reference.reachabilityFence(b);
50                 if (this != null) { this.ptrs_to.add(b); };
51                 return ret;
52         }
53
54         @Override public boolean equals(Object o) {
55                 if (!(o instanceof UnknownPaymentContext)) return false;
56                 return this.eq((UnknownPaymentContext)o);
57         }
58         /**
59          * Serialize the UnknownPaymentContext object into a byte array which can be read by UnknownPaymentContext_read
60          */
61         public byte[] write() {
62                 byte[] ret = bindings.UnknownPaymentContext_write(this.ptr);
63                 Reference.reachabilityFence(this);
64                 return ret;
65         }
66
67         /**
68          * Read a UnknownPaymentContext from a byte array, created by UnknownPaymentContext_write
69          */
70         public static Result_UnknownPaymentContextDecodeErrorZ read(byte[] ser) {
71                 long ret = bindings.UnknownPaymentContext_read(ser);
72                 Reference.reachabilityFence(ser);
73                 if (ret >= 0 && ret <= 4096) { return null; }
74                 Result_UnknownPaymentContextDecodeErrorZ ret_hu_conv = Result_UnknownPaymentContextDecodeErrorZ.constr_from_ptr(ret);
75                 return ret_hu_conv;
76         }
77
78 }