1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
7 import java.lang.ref.Reference;
8 import javax.annotation.Nullable;
12 * Data of the `RawInvoice` that is encoded in the data part
14 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
15 public class RawDataPart extends CommonBase {
16 RawDataPart(Object _dummy, long ptr) { super(ptr); }
17 @Override @SuppressWarnings("deprecation")
18 protected void finalize() throws Throwable {
20 if (ptr != 0) { bindings.RawDataPart_free(ptr); }
24 * generation time of the invoice
26 public PositiveTimestamp get_timestamp() {
27 long ret = bindings.RawDataPart_get_timestamp(this.ptr);
28 Reference.reachabilityFence(this);
29 if (ret >= 0 && ret <= 4096) { return null; }
30 PositiveTimestamp ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PositiveTimestamp(null, ret); }
31 ret_hu_conv.ptrs_to.add(this);
36 * generation time of the invoice
38 public void set_timestamp(PositiveTimestamp val) {
39 bindings.RawDataPart_set_timestamp(this.ptr, val == null ? 0 : val.ptr & ~1);
40 Reference.reachabilityFence(this);
41 Reference.reachabilityFence(val);
45 * Checks if two RawDataParts contain equal inner contents.
46 * This ignores pointers and is_owned flags and looks at the values in fields.
47 * Two objects with NULL inner values will be considered "equal" here.
49 public boolean eq(RawDataPart b) {
50 boolean ret = bindings.RawDataPart_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
51 Reference.reachabilityFence(this);
52 Reference.reachabilityFence(b);
57 @Override public boolean equals(Object o) {
58 if (!(o instanceof RawDataPart)) return false;
59 return this.eq((RawDataPart)o);
62 long ret = bindings.RawDataPart_clone_ptr(this.ptr);
63 Reference.reachabilityFence(this);
68 * Creates a copy of the RawDataPart
70 public RawDataPart clone() {
71 long ret = bindings.RawDataPart_clone(this.ptr);
72 Reference.reachabilityFence(this);
73 if (ret >= 0 && ret <= 4096) { return null; }
74 RawDataPart ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RawDataPart(null, ret); }
75 ret_hu_conv.ptrs_to.add(this);