X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FResult_CVec_u8ZPeerHandleErrorZ.java;h=7a39399246642e0fe22f1d423893f44e1ff2c4b9;hb=a442b8532ad57aed1fc740141189899b39a15d79;hp=3ef723e6c19d4f8e8d0a1f351aa3cfc4c7cb3608;hpb=aa0e2aade37133339f4113a0cd7465b111f0a0d0;p=ldk-java diff --git a/src/main/java/org/ldk/structs/Result_CVec_u8ZPeerHandleErrorZ.java b/src/main/java/org/ldk/structs/Result_CVec_u8ZPeerHandleErrorZ.java index 3ef723e6..7a393992 100644 --- a/src/main/java/org/ldk/structs/Result_CVec_u8ZPeerHandleErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_CVec_u8ZPeerHandleErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_CVec_u8ZPeerHandleErrorZ extends CommonBase { private Result_CVec_u8ZPeerHandleErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { @@ -25,9 +24,6 @@ public class Result_CVec_u8ZPeerHandleErrorZ extends CommonBase { super(_dummy, ptr); this.res = bindings.LDKCResult_CVec_u8ZPeerHandleErrorZ_get_ok(ptr); } - public Result_CVec_u8ZPeerHandleErrorZ_OK(byte[] res) { - this(null, bindings.CResult_CVec_u8ZPeerHandleErrorZ_ok(res)); - } } public static final class Result_CVec_u8ZPeerHandleErrorZ_Err extends Result_CVec_u8ZPeerHandleErrorZ { @@ -36,11 +32,38 @@ public class Result_CVec_u8ZPeerHandleErrorZ extends CommonBase { super(_dummy, ptr); long err = bindings.LDKCResult_CVec_u8ZPeerHandleErrorZ_get_err(ptr); PeerHandleError err_hu_conv = new PeerHandleError(null, err); + err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_CVec_u8ZPeerHandleErrorZ_Err(PeerHandleError err) { - this(null, bindings.CResult_CVec_u8ZPeerHandleErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state. + */ + public static Result_CVec_u8ZPeerHandleErrorZ ok(byte[] o) { + long ret = bindings.CResult_CVec_u8ZPeerHandleErrorZ_ok(o); + Result_CVec_u8ZPeerHandleErrorZ ret_hu_conv = Result_CVec_u8ZPeerHandleErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state. + */ + public static Result_CVec_u8ZPeerHandleErrorZ err(PeerHandleError e) { + long ret = bindings.CResult_CVec_u8ZPeerHandleErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_CVec_u8ZPeerHandleErrorZ ret_hu_conv = Result_CVec_u8ZPeerHandleErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_CVec_u8ZPeerHandleErrorZ clone() { + long ret = bindings.CResult_CVec_u8ZPeerHandleErrorZ_clone(this.ptr); + Result_CVec_u8ZPeerHandleErrorZ ret_hu_conv = Result_CVec_u8ZPeerHandleErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + }