X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FResult_NoneSemanticErrorZ.java;h=902447c36192aa5be6cd39812ddc7c6b139b03a2;hb=1854b5cebef22ace9e9e4dd191f609818df9ce08;hp=eaa13eb54956816146a7726973f0a938ddd71f45;hpb=ba1af51214a8ea2de62b84cd23b6145173c71752;p=ldk-java diff --git a/src/main/java/org/ldk/structs/Result_NoneSemanticErrorZ.java b/src/main/java/org/ldk/structs/Result_NoneSemanticErrorZ.java index eaa13eb5..902447c3 100644 --- a/src/main/java/org/ldk/structs/Result_NoneSemanticErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NoneSemanticErrorZ.java @@ -4,6 +4,7 @@ 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; public class Result_NoneSemanticErrorZ extends CommonBase { @@ -13,7 +14,7 @@ public class Result_NoneSemanticErrorZ extends CommonBase { } static Result_NoneSemanticErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_NoneSemanticErrorZ_result_ok(ptr)) { + if (bindings.CResult_NoneSemanticErrorZ_is_ok(ptr)) { return new Result_NoneSemanticErrorZ_OK(null, ptr); } else { return new Result_NoneSemanticErrorZ_Err(null, ptr); @@ -38,7 +39,7 @@ public class Result_NoneSemanticErrorZ extends CommonBase { */ public static Result_NoneSemanticErrorZ ok() { long ret = bindings.CResult_NoneSemanticErrorZ_ok(); - if (ret < 1024) { return null; } + if (ret >= 0 && ret <= 4096) { return null; } Result_NoneSemanticErrorZ ret_hu_conv = Result_NoneSemanticErrorZ.constr_from_ptr(ret); return ret_hu_conv; } @@ -48,18 +49,35 @@ public class Result_NoneSemanticErrorZ extends CommonBase { */ public static Result_NoneSemanticErrorZ err(org.ldk.enums.SemanticError e) { long ret = bindings.CResult_NoneSemanticErrorZ_err(e); - if (ret < 1024) { return null; } + Reference.reachabilityFence(e); + if (ret >= 0 && ret <= 4096) { return null; } Result_NoneSemanticErrorZ ret_hu_conv = Result_NoneSemanticErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_NoneSemanticErrorZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_NoneSemanticErrorZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + /** * Creates a new CResult_NoneSemanticErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. */ public Result_NoneSemanticErrorZ clone() { long ret = bindings.CResult_NoneSemanticErrorZ_clone(this.ptr); - if (ret < 1024) { return null; } + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } Result_NoneSemanticErrorZ ret_hu_conv = Result_NoneSemanticErrorZ.constr_from_ptr(ret); return ret_hu_conv; }