/**
* Constructs a new InvoiceError given each field
+ *
+ * Note that erroneous_field_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
*/
- public static InvoiceError of(org.ldk.structs.ErroneousField erroneous_field_arg, org.ldk.structs.UntrustedString message_arg) {
+ public static InvoiceError of(@Nullable org.ldk.structs.ErroneousField erroneous_field_arg, org.ldk.structs.UntrustedString message_arg) {
long ret = bindings.InvoiceError_new(erroneous_field_arg == null ? 0 : erroneous_field_arg.ptr, message_arg == null ? 0 : message_arg.ptr);
Reference.reachabilityFence(erroneous_field_arg);
Reference.reachabilityFence(message_arg);
return ret_hu_conv;
}
+ /**
+ * Creates an [`InvoiceError`] with the given message.
+ */
+ public static InvoiceError from_string(java.lang.String s) {
+ long ret = bindings.InvoiceError_from_string(s);
+ Reference.reachabilityFence(s);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.InvoiceError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceError(null, ret); }
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
+ return ret_hu_conv;
+ }
+
/**
* Serialize the InvoiceError object into a byte array which can be read by InvoiceError_read
*/