Merge pull request #2 from TheBlueMatt/main
[ldk-java] / src / main / java / org / ldk / structs / Init.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
8 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
9 public class Init extends CommonBase {
10         Init(Object _dummy, long ptr) { super(ptr); }
11         @Override @SuppressWarnings("deprecation")
12         protected void finalize() throws Throwable {
13                 super.finalize();
14                 if (ptr != 0) { bindings.Init_free(ptr); }
15         }
16
17         public InitFeatures get_features() {
18                 long ret = bindings.Init_get_features(this.ptr);
19                 InitFeatures ret_hu_conv = new InitFeatures(null, ret);
20                 ret_hu_conv.ptrs_to.add(this);
21                 return ret_hu_conv;
22         }
23
24         public void set_features(InitFeatures val) {
25                 bindings.Init_set_features(this.ptr, val == null ? 0 : val.ptr & ~1);
26                 this.ptrs_to.add(val);
27         }
28
29         public static Init constructor_new(InitFeatures features_arg) {
30                 long ret = bindings.Init_new(features_arg == null ? 0 : features_arg.ptr & ~1);
31                 Init ret_hu_conv = new Init(null, ret);
32                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
33                 ret_hu_conv.ptrs_to.add(features_arg);
34                 return ret_hu_conv;
35         }
36
37         public Init clone() {
38                 long ret = bindings.Init_clone(this.ptr);
39                 Init ret_hu_conv = new Init(null, ret);
40                 ret_hu_conv.ptrs_to.add(this);
41                 return ret_hu_conv;
42         }
43
44         public byte[] write() {
45                 byte[] ret = bindings.Init_write(this.ptr);
46                 return ret;
47         }
48
49         public static Result_InitDecodeErrorZ constructor_read(byte[] ser) {
50                 long ret = bindings.Init_read(ser);
51                 Result_InitDecodeErrorZ ret_hu_conv = Result_InitDecodeErrorZ.constr_from_ptr(ret);
52                 return ret_hu_conv;
53         }
54
55 }