X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FResult_NoneLightningErrorZ.java;h=7852ba30f9dc8e1d6f6e42878bb5c4d852574625;hb=c6bac88847b7c09560af81f00ba8dd3c2ebe3a19;hp=7f150a19215bc7238681f16ac3e52c76a54ee492;hpb=c3ae2d6897e5a809459c8d9a72a4b3aa0052c8c8;p=ldk-java diff --git a/src/main/java/org/ldk/structs/Result_NoneLightningErrorZ.java b/src/main/java/org/ldk/structs/Result_NoneLightningErrorZ.java index 7f150a19..7852ba30 100644 --- a/src/main/java/org/ldk/structs/Result_NoneLightningErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NoneLightningErrorZ.java @@ -4,6 +4,7 @@ import org.ldk.impl.bindings; import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; +import javax.annotation.Nullable; public class Result_NoneLightningErrorZ extends CommonBase { private Result_NoneLightningErrorZ(Object _dummy, long ptr) { super(ptr); } @@ -29,7 +30,7 @@ public class Result_NoneLightningErrorZ extends CommonBase { private Result_NoneLightningErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.LDKCResult_NoneLightningErrorZ_get_err(ptr); - LightningError err_hu_conv = new LightningError(null, err); + LightningError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new LightningError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } @@ -38,8 +39,9 @@ public class Result_NoneLightningErrorZ extends CommonBase { /** * Creates a new CResult_NoneLightningErrorZ in the success state. */ - public static Result_NoneLightningErrorZ constructor_ok() { + public static Result_NoneLightningErrorZ ok() { long ret = bindings.CResult_NoneLightningErrorZ_ok(); + if (ret >= 0 && ret <= 4096) { return null; } Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); return ret_hu_conv; } @@ -47,10 +49,10 @@ public class Result_NoneLightningErrorZ extends CommonBase { /** * Creates a new CResult_NoneLightningErrorZ in the error state. */ - public static Result_NoneLightningErrorZ constructor_err(LightningError e) { + public static Result_NoneLightningErrorZ err(LightningError e) { long ret = bindings.CResult_NoneLightningErrorZ_err(e == null ? 0 : e.ptr & ~1); + if (ret >= 0 && ret <= 4096) { return null; } Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(e); return ret_hu_conv; } @@ -60,6 +62,7 @@ public class Result_NoneLightningErrorZ extends CommonBase { */ public Result_NoneLightningErrorZ clone() { long ret = bindings.CResult_NoneLightningErrorZ_clone(this.ptr); + if (ret >= 0 && ret <= 4096) { return null; } Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); return ret_hu_conv; }