6 namespace org { namespace ldk { namespace structs {
10 * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
12 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
13 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
15 public class ErroneousField : CommonBase {
16 internal ErroneousField(object _dummy, long ptr) : base(ptr) { }
18 if (ptr != 0) { bindings.ErroneousField_free(ptr); }
22 * The type number of the TLV field containing the error.
24 public long get_tlv_fieldnum() {
25 long ret = bindings.ErroneousField_get_tlv_fieldnum(this.ptr);
31 * The type number of the TLV field containing the error.
33 public void set_tlv_fieldnum(long val) {
34 bindings.ErroneousField_set_tlv_fieldnum(this.ptr, val);
40 * A value to use for the TLV field to avoid the error.
42 * Returns a copy of the field.
44 public Option_CVec_u8ZZ get_suggested_value() {
45 long ret = bindings.ErroneousField_get_suggested_value(this.ptr);
47 if (ret >= 0 && ret <= 4096) { return null; }
48 org.ldk.structs.Option_CVec_u8ZZ ret_hu_conv = org.ldk.structs.Option_CVec_u8ZZ.constr_from_ptr(ret);
49 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
54 * A value to use for the TLV field to avoid the error.
56 public void set_suggested_value(org.ldk.structs.Option_CVec_u8ZZ val) {
57 bindings.ErroneousField_set_suggested_value(this.ptr, val.ptr);
60 if (this != null) { this.ptrs_to.AddLast(val); };
64 * Constructs a new ErroneousField given each field
66 public static ErroneousField of(long tlv_fieldnum_arg, org.ldk.structs.Option_CVec_u8ZZ suggested_value_arg) {
67 long ret = bindings.ErroneousField_new(tlv_fieldnum_arg, suggested_value_arg.ptr);
68 GC.KeepAlive(tlv_fieldnum_arg);
69 GC.KeepAlive(suggested_value_arg);
70 if (ret >= 0 && ret <= 4096) { return null; }
71 org.ldk.structs.ErroneousField ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ErroneousField(null, ret); }
72 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
73 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(suggested_value_arg); };
77 internal long clone_ptr() {
78 long ret = bindings.ErroneousField_clone_ptr(this.ptr);
84 * Creates a copy of the ErroneousField
86 public ErroneousField clone() {
87 long ret = bindings.ErroneousField_clone(this.ptr);
89 if (ret >= 0 && ret <= 4096) { return null; }
90 org.ldk.structs.ErroneousField ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ErroneousField(null, ret); }
91 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };