X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FResult_PositiveTimestampCreationErrorZ.java;h=f138e542ee08e461629adcbedb4a64c353558cd2;hb=1854b5cebef22ace9e9e4dd191f609818df9ce08;hp=33f5cedd21aed0062eee62eb8b1ce830b107c1bd;hpb=32692e00046b7ec16b6a2e20bd54800b2b48d4c0;p=ldk-java diff --git a/src/main/java/org/ldk/structs/Result_PositiveTimestampCreationErrorZ.java b/src/main/java/org/ldk/structs/Result_PositiveTimestampCreationErrorZ.java index 33f5cedd..f138e542 100644 --- a/src/main/java/org/ldk/structs/Result_PositiveTimestampCreationErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PositiveTimestampCreationErrorZ.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_PositiveTimestampCreationErrorZ extends CommonBase { @@ -13,7 +14,7 @@ public class Result_PositiveTimestampCreationErrorZ extends CommonBase { } static Result_PositiveTimestampCreationErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_PositiveTimestampCreationErrorZ_result_ok(ptr)) { + if (bindings.CResult_PositiveTimestampCreationErrorZ_is_ok(ptr)) { return new Result_PositiveTimestampCreationErrorZ_OK(null, ptr); } else { return new Result_PositiveTimestampCreationErrorZ_Err(null, ptr); @@ -24,7 +25,7 @@ public class Result_PositiveTimestampCreationErrorZ extends CommonBase { private Result_PositiveTimestampCreationErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.LDKCResult_PositiveTimestampCreationErrorZ_get_ok(ptr); - PositiveTimestamp res_hu_conv = new PositiveTimestamp(null, res); + PositiveTimestamp res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new PositiveTimestamp(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -43,7 +44,8 @@ public class Result_PositiveTimestampCreationErrorZ extends CommonBase { */ public static Result_PositiveTimestampCreationErrorZ ok(PositiveTimestamp o) { long ret = bindings.CResult_PositiveTimestampCreationErrorZ_ok(o == null ? 0 : o.ptr & ~1); - if (ret >= 0 && ret < 1024) { return null; } + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } Result_PositiveTimestampCreationErrorZ ret_hu_conv = Result_PositiveTimestampCreationErrorZ.constr_from_ptr(ret); return ret_hu_conv; } @@ -53,18 +55,35 @@ public class Result_PositiveTimestampCreationErrorZ extends CommonBase { */ public static Result_PositiveTimestampCreationErrorZ err(org.ldk.enums.CreationError e) { long ret = bindings.CResult_PositiveTimestampCreationErrorZ_err(e); - if (ret >= 0 && ret < 1024) { return null; } + Reference.reachabilityFence(e); + if (ret >= 0 && ret <= 4096) { return null; } Result_PositiveTimestampCreationErrorZ ret_hu_conv = Result_PositiveTimestampCreationErrorZ.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_PositiveTimestampCreationErrorZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_PositiveTimestampCreationErrorZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + /** * Creates a new CResult_PositiveTimestampCreationErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. */ public Result_PositiveTimestampCreationErrorZ clone() { long ret = bindings.CResult_PositiveTimestampCreationErrorZ_clone(this.ptr); - if (ret >= 0 && ret < 1024) { return null; } + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } Result_PositiveTimestampCreationErrorZ ret_hu_conv = Result_PositiveTimestampCreationErrorZ.constr_from_ptr(ret); return ret_hu_conv; }