6 namespace org { namespace ldk { namespace structs {
10 * A user-defined name for a node, which may be used when displaying the node in a graph.
12 * Since node aliases are provided by third parties, they are a potential avenue for injection
13 * attacks. Care must be taken when processing.
15 public class NodeAlias : CommonBase {
16 internal NodeAlias(object _dummy, long ptr) : base(ptr) { }
18 if (ptr != 0) { bindings.NodeAlias_free(ptr); }
21 public byte[] get_a() {
22 byte[] ret = bindings.NodeAlias_get_a(this.ptr);
27 public void set_a(byte[] val) {
28 bindings.NodeAlias_set_a(this.ptr, InternalUtils.check_arr_len(val, 32));
34 * Constructs a new NodeAlias given each field
36 public static NodeAlias of(byte[] a_arg) {
37 long ret = bindings.NodeAlias_new(InternalUtils.check_arr_len(a_arg, 32));
39 if (ret >= 0 && ret <= 4096) { return null; }
40 org.ldk.structs.NodeAlias ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeAlias(null, ret); }
41 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
45 internal long clone_ptr() {
46 long ret = bindings.NodeAlias_clone_ptr(this.ptr);
52 * Creates a copy of the NodeAlias
54 public NodeAlias clone() {
55 long ret = bindings.NodeAlias_clone(this.ptr);
57 if (ret >= 0 && ret <= 4096) { return null; }
58 org.ldk.structs.NodeAlias ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeAlias(null, ret); }
59 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
64 * Checks if two NodeAliass contain equal inner contents.
65 * This ignores pointers and is_owned flags and looks at the values in fields.
66 * Two objects with NULL inner values will be considered "equal" here.
68 public bool eq(org.ldk.structs.NodeAlias b) {
69 bool ret = bindings.NodeAlias_eq(this.ptr, b == null ? 0 : b.ptr);
72 if (this != null) { this.ptrs_to.AddLast(b); };
76 public override bool Equals(object o) {
77 if (!(o is NodeAlias)) return false;
78 return this.eq((NodeAlias)o);
81 * Serialize the NodeAlias object into a byte array which can be read by NodeAlias_read
83 public byte[] write() {
84 byte[] ret = bindings.NodeAlias_write(this.ptr);
90 * Read a NodeAlias from a byte array, created by NodeAlias_write
92 public static Result_NodeAliasDecodeErrorZ read(byte[] ser) {
93 long ret = bindings.NodeAlias_read(ser);
95 if (ret >= 0 && ret <= 4096) { return null; }
96 Result_NodeAliasDecodeErrorZ ret_hu_conv = Result_NodeAliasDecodeErrorZ.constr_from_ptr(ret);