6 namespace org { namespace ldk { namespace structs {
9 * An enum which can either contain a crate::c_types::derived::CVec_ThirtyTwoBytesZ or not
11 public class Option_CVec_ThirtyTwoBytesZZ : CommonBase {
12 protected Option_CVec_ThirtyTwoBytesZZ(object _dummy, long ptr) : base(ptr) { }
13 ~Option_CVec_ThirtyTwoBytesZZ() {
14 if (ptr != 0) { bindings.COption_CVec_ThirtyTwoBytesZZ_free(ptr); }
17 internal static Option_CVec_ThirtyTwoBytesZZ constr_from_ptr(long ptr) {
18 long raw_ty = bindings.LDKCOption_CVec_ThirtyTwoBytesZZ_ty_from_ptr(ptr);
20 case 0: return new Option_CVec_ThirtyTwoBytesZZ_Some(ptr);
21 case 1: return new Option_CVec_ThirtyTwoBytesZZ_None(ptr);
23 throw new ArgumentException("Impossible enum variant");
27 /** A Option_CVec_ThirtyTwoBytesZZ of type Some */
28 public class Option_CVec_ThirtyTwoBytesZZ_Some : Option_CVec_ThirtyTwoBytesZZ {
30 internal Option_CVec_ThirtyTwoBytesZZ_Some(long ptr) : base(null, ptr) {
31 long some = bindings.LDKCOption_CVec_ThirtyTwoBytesZZ_Some_get_some(ptr);
32 int some_conv_8_len = InternalUtils.getArrayLength(some);
33 byte[][] some_conv_8_arr = new byte[some_conv_8_len][];
34 for (int i = 0; i < some_conv_8_len; i++) {
35 long some_conv_8 = InternalUtils.getU64ArrayElem(some, i);
36 byte[] some_conv_8_conv = InternalUtils.decodeUint8Array(some_conv_8);
37 some_conv_8_arr[i] = some_conv_8_conv;
39 bindings.free_buffer(some);
40 this.some = some_conv_8_arr;
43 /** A Option_CVec_ThirtyTwoBytesZZ of type None */
44 public class Option_CVec_ThirtyTwoBytesZZ_None : Option_CVec_ThirtyTwoBytesZZ {
45 internal Option_CVec_ThirtyTwoBytesZZ_None(long ptr) : base(null, ptr) {
49 * Constructs a new COption_CVec_ThirtyTwoBytesZZ containing a crate::c_types::derived::CVec_ThirtyTwoBytesZ
51 public static Option_CVec_ThirtyTwoBytesZZ some(byte[][] o) {
52 long ret = bindings.COption_CVec_ThirtyTwoBytesZZ_some(InternalUtils.encodeUint64Array(InternalUtils.mapArray(o, o_conv_8 => InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(o_conv_8, 32)))));
54 if (ret >= 0 && ret <= 4096) { return null; }
55 org.ldk.structs.Option_CVec_ThirtyTwoBytesZZ ret_hu_conv = org.ldk.structs.Option_CVec_ThirtyTwoBytesZZ.constr_from_ptr(ret);
56 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
61 * Constructs a new COption_CVec_ThirtyTwoBytesZZ containing nothing
63 public static Option_CVec_ThirtyTwoBytesZZ none() {
64 long ret = bindings.COption_CVec_ThirtyTwoBytesZZ_none();
65 if (ret >= 0 && ret <= 4096) { return null; }
66 org.ldk.structs.Option_CVec_ThirtyTwoBytesZZ ret_hu_conv = org.ldk.structs.Option_CVec_ThirtyTwoBytesZZ.constr_from_ptr(ret);
67 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
71 internal long clone_ptr() {
72 long ret = bindings.COption_CVec_ThirtyTwoBytesZZ_clone_ptr(this.ptr);
78 * Creates a new COption_CVec_ThirtyTwoBytesZZ which has the same data as `orig`
79 * but with all dynamically-allocated buffers duplicated in new buffers.
81 public Option_CVec_ThirtyTwoBytesZZ clone() {
82 long ret = bindings.COption_CVec_ThirtyTwoBytesZZ_clone(this.ptr);
84 if (ret >= 0 && ret <= 4096) { return null; }
85 org.ldk.structs.Option_CVec_ThirtyTwoBytesZZ ret_hu_conv = org.ldk.structs.Option_CVec_ThirtyTwoBytesZZ.constr_from_ptr(ret);
86 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };