X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FResult_UpdateFulfillHTLCDecodeErrorZ.java;h=0f2302dca00289f582cf7e6a2519a195920593aa;hb=ba1af51214a8ea2de62b84cd23b6145173c71752;hp=fb60f5e0518ccd7fe1b3033dfe03b1a9cdaddb97;hpb=276893d3b8bd3fcb2bb10e3cab73a69d34831909;p=ldk-java diff --git a/src/main/java/org/ldk/structs/Result_UpdateFulfillHTLCDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UpdateFulfillHTLCDecodeErrorZ.java index fb60f5e0..0f2302dc 100644 --- a/src/main/java/org/ldk/structs/Result_UpdateFulfillHTLCDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UpdateFulfillHTLCDecodeErrorZ.java @@ -4,8 +4,8 @@ import org.ldk.impl.bindings; import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; +import javax.annotation.Nullable; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_UpdateFulfillHTLCDecodeErrorZ extends CommonBase { private Result_UpdateFulfillHTLCDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { @@ -28,10 +28,6 @@ public class Result_UpdateFulfillHTLCDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_UpdateFulfillHTLCDecodeErrorZ_OK(UpdateFulfillHTLC res) { - this(null, bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_UpdateFulfillHTLCDecodeErrorZ_Err extends Result_UpdateFulfillHTLCDecodeErrorZ { @@ -43,9 +39,39 @@ public class Result_UpdateFulfillHTLCDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_UpdateFulfillHTLCDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state. + */ + public static Result_UpdateFulfillHTLCDecodeErrorZ ok(UpdateFulfillHTLC o) { + long ret = bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + if (ret < 1024) { return null; } + Result_UpdateFulfillHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFulfillHTLCDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state. + */ + public static Result_UpdateFulfillHTLCDecodeErrorZ err(DecodeError e) { + long ret = bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + if (ret < 1024) { return null; } + Result_UpdateFulfillHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFulfillHTLCDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_UpdateFulfillHTLCDecodeErrorZ clone() { + long ret = bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_clone(this.ptr); + if (ret < 1024) { return null; } + Result_UpdateFulfillHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFulfillHTLCDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + }