X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FOption_TypeZ.java;h=e528bdcbdf35bf97b094eb1648ca2f64dd57abe9;hb=f3e670e9341decac613d33fc52febf19cea32f20;hp=cb1b3e7849e488a64705943f038d7fb645f40c00;hpb=7d6be8a5ef72a4ebfe07660cce55f43f6cc30b80;p=ldk-java diff --git a/src/main/java/org/ldk/structs/Option_TypeZ.java b/src/main/java/org/ldk/structs/Option_TypeZ.java index cb1b3e78..e528bdcb 100644 --- a/src/main/java/org/ldk/structs/Option_TypeZ.java +++ b/src/main/java/org/ldk/structs/Option_TypeZ.java @@ -29,6 +29,9 @@ public class Option_TypeZ extends CommonBase { assert false; return null; // Unreachable without extending the (internal) bindings interface } + /** + * When we're in this state, this COption_TypeZ contains a crate::lightning::ln::wire::Type + */ public final static class Some extends Option_TypeZ { public final Type some; private Some(long ptr, bindings.LDKCOption_TypeZ.Some obj) { @@ -39,6 +42,9 @@ public class Option_TypeZ extends CommonBase { this.some = ret_hu_conv; } } + /** + * When we're in this state, this COption_TypeZ contains nothing + */ public final static class None extends Option_TypeZ { private None(long ptr, bindings.LDKCOption_TypeZ.None obj) { super(null, ptr); @@ -49,7 +55,7 @@ public class Option_TypeZ extends CommonBase { */ public static Option_TypeZ some(Type o) { long ret = bindings.COption_TypeZ_some(o == null ? 0 : o.ptr); - if (ret < 1024) { return null; } + if (ret >= 0 && ret <= 4096) { return null; } Option_TypeZ ret_hu_conv = Option_TypeZ.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); ret_hu_conv.ptrs_to.add(o); @@ -61,19 +67,24 @@ public class Option_TypeZ extends CommonBase { */ public static Option_TypeZ none() { long ret = bindings.COption_TypeZ_none(); - if (ret < 1024) { return null; } + if (ret >= 0 && ret <= 4096) { return null; } Option_TypeZ ret_hu_conv = Option_TypeZ.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.COption_TypeZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new COption_TypeZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. */ public Option_TypeZ clone() { long ret = bindings.COption_TypeZ_clone(this.ptr); - if (ret < 1024) { return null; } + if (ret >= 0 && ret <= 4096) { return null; } Option_TypeZ ret_hu_conv = Option_TypeZ.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(this); return ret_hu_conv;