X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FOption_C2Tuple_usizeTransactionZZ.java;h=526b06c5f6790868459fef59760ce8f8f43dc935;hb=ff3dacec3be60f870d81f6df11bd9fff92aa6047;hp=64379719685eab38777fdb3455533b8360e376b0;hpb=c3ae2d6897e5a809459c8d9a72a4b3aa0052c8c8;p=ldk-java diff --git a/src/main/java/org/ldk/structs/Option_C2Tuple_usizeTransactionZZ.java b/src/main/java/org/ldk/structs/Option_C2Tuple_usizeTransactionZZ.java index 64379719..526b06c5 100644 --- a/src/main/java/org/ldk/structs/Option_C2Tuple_usizeTransactionZZ.java +++ b/src/main/java/org/ldk/structs/Option_C2Tuple_usizeTransactionZZ.java @@ -4,6 +4,8 @@ import org.ldk.impl.bindings; import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; /** @@ -28,19 +30,22 @@ public class Option_C2Tuple_usizeTransactionZZ extends CommonBase { assert false; return null; // Unreachable without extending the (internal) bindings interface } + /** + * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains a crate::c_types::derived::C2Tuple_usizeTransactionZ + */ public final static class Some extends Option_C2Tuple_usizeTransactionZZ { - public final TwoTuple some; + public final org.ldk.structs.TwoTuple_usizeTransactionZ some; private Some(long ptr, bindings.LDKCOption_C2Tuple_usizeTransactionZZ.Some obj) { super(null, ptr); long some = obj.some; - long some_a = bindings.LDKC2Tuple_usizeTransactionZ_get_a(some); - byte[] some_b = bindings.LDKC2Tuple_usizeTransactionZ_get_b(some); - TwoTuple some_conv = new TwoTuple(some_a, some_b, () -> { - bindings.C2Tuple_usizeTransactionZ_free(some); - }); - this.some = some_conv; + TwoTuple_usizeTransactionZ some_hu_conv = new TwoTuple_usizeTransactionZ(null, some); + some_hu_conv.ptrs_to.add(this); + this.some = some_hu_conv; } } + /** + * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains nothing + */ public final static class None extends Option_C2Tuple_usizeTransactionZZ { private None(long ptr, bindings.LDKCOption_C2Tuple_usizeTransactionZZ.None obj) { super(null, ptr); @@ -49,9 +54,11 @@ public class Option_C2Tuple_usizeTransactionZZ extends CommonBase { /** * Constructs a new COption_C2Tuple_usizeTransactionZZ containing a crate::c_types::derived::C2Tuple_usizeTransactionZ */ - public static Option_C2Tuple_usizeTransactionZZ constructor_some(TwoTuple o) { - long ret = bindings.COption_C2Tuple_usizeTransactionZZ_some(bindings.C2Tuple_usizeTransactionZ_new(o.a, o.b)); - Option_C2Tuple_usizeTransactionZZ ret_hu_conv = Option_C2Tuple_usizeTransactionZZ.constr_from_ptr(ret); + public static Option_C2Tuple_usizeTransactionZZ some(TwoTuple_usizeTransactionZ o) { + long ret = bindings.COption_C2Tuple_usizeTransactionZZ_some(o != null ? o.ptr : 0); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_C2Tuple_usizeTransactionZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_usizeTransactionZZ.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -59,11 +66,31 @@ public class Option_C2Tuple_usizeTransactionZZ extends CommonBase { /** * Constructs a new COption_C2Tuple_usizeTransactionZZ containing nothing */ - public static Option_C2Tuple_usizeTransactionZZ constructor_none() { + public static Option_C2Tuple_usizeTransactionZZ none() { long ret = bindings.COption_C2Tuple_usizeTransactionZZ_none(); - Option_C2Tuple_usizeTransactionZZ ret_hu_conv = Option_C2Tuple_usizeTransactionZZ.constr_from_ptr(ret); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_C2Tuple_usizeTransactionZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_usizeTransactionZZ.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.COption_C2Tuple_usizeTransactionZZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new COption_C2Tuple_usizeTransactionZZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_C2Tuple_usizeTransactionZZ clone() { + long ret = bindings.COption_C2Tuple_usizeTransactionZZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_C2Tuple_usizeTransactionZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_usizeTransactionZZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + }