X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FResult_NoneSemanticErrorZ.java;h=146bef93be64dd2172ff0519caf33df2a5ef64eb;hb=d87886bb194886ef86d3597a5cdc142b6ccc89e9;hp=85a9ae7adb86139610b839df00b9ab89a6071fe9;hpb=32692e00046b7ec16b6a2e20bd54800b2b48d4c0;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 85a9ae7a..146bef93 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); @@ -29,7 +30,7 @@ public class Result_NoneSemanticErrorZ extends CommonBase { public final SemanticError err; private Result_NoneSemanticErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); - this.err = bindings.LDKCResult_NoneSemanticErrorZ_get_err(ptr); + this.err = bindings.CResult_NoneSemanticErrorZ_get_err(ptr); } } @@ -38,7 +39,7 @@ public class Result_NoneSemanticErrorZ extends CommonBase { */ public static Result_NoneSemanticErrorZ ok() { long ret = bindings.CResult_NoneSemanticErrorZ_ok(); - if (ret >= 0 && 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 >= 0 && 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 >= 0 && 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; }