X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FPaymentSendFailure.java;h=c9963b58d6af07be563d085c89e1a204ab2570da;hb=ba1af51214a8ea2de62b84cd23b6145173c71752;hp=4e9bb14976d3f4eb311dd718187d21dfa27a734f;hpb=8cf3b60169033bf14824aeed1197f11e232cba0a;p=ldk-java diff --git a/src/main/java/org/ldk/structs/PaymentSendFailure.java b/src/main/java/org/ldk/structs/PaymentSendFailure.java index 4e9bb149..c9963b58 100644 --- a/src/main/java/org/ldk/structs/PaymentSendFailure.java +++ b/src/main/java/org/ldk/structs/PaymentSendFailure.java @@ -4,6 +4,7 @@ import org.ldk.impl.bindings; import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; +import javax.annotation.Nullable; /** @@ -94,9 +95,57 @@ public class PaymentSendFailure extends CommonBase { */ public PaymentSendFailure clone() { long ret = bindings.PaymentSendFailure_clone(this.ptr); + if (ret < 1024) { return null; } PaymentSendFailure ret_hu_conv = PaymentSendFailure.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } + /** + * Utility method to constructs a new ParameterError-variant PaymentSendFailure + */ + public static PaymentSendFailure parameter_error(APIError a) { + long ret = bindings.PaymentSendFailure_parameter_error(a.ptr); + if (ret < 1024) { return null; } + PaymentSendFailure ret_hu_conv = PaymentSendFailure.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + /** + * Utility method to constructs a new PathParameterError-variant PaymentSendFailure + */ + public static PaymentSendFailure path_parameter_error(Result_NoneAPIErrorZ[] a) { + long ret = bindings.PaymentSendFailure_path_parameter_error(a != null ? Arrays.stream(a).mapToLong(a_conv_22 -> a_conv_22 != null ? a_conv_22.ptr : 0).toArray() : null); + if (ret < 1024) { return null; } + PaymentSendFailure ret_hu_conv = PaymentSendFailure.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + /* TODO 2 Result_NoneAPIErrorZ */; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new AllFailedRetrySafe-variant PaymentSendFailure + */ + public static PaymentSendFailure all_failed_retry_safe(APIError[] a) { + long ret = bindings.PaymentSendFailure_all_failed_retry_safe(a != null ? Arrays.stream(a).mapToLong(a_conv_10 -> a_conv_10.ptr).toArray() : null); + if (ret < 1024) { return null; } + PaymentSendFailure ret_hu_conv = PaymentSendFailure.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + /* TODO 2 APIError */; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new PartialFailure-variant PaymentSendFailure + */ + public static PaymentSendFailure partial_failure(Result_NoneAPIErrorZ[] a) { + long ret = bindings.PaymentSendFailure_partial_failure(a != null ? Arrays.stream(a).mapToLong(a_conv_22 -> a_conv_22 != null ? a_conv_22.ptr : 0).toArray() : null); + if (ret < 1024) { return null; } + PaymentSendFailure ret_hu_conv = PaymentSendFailure.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + /* TODO 2 Result_NoneAPIErrorZ */; + return ret_hu_conv; + } + }