6 namespace org { namespace ldk { namespace structs {
10 * Represents a hostname for serialization purposes.
11 * Only the character set and length will be validated.
12 * The character set consists of ASCII alphanumeric characters, hyphens, and periods.
13 * Its length is guaranteed to be representable by a single byte.
14 * This serialization is used by BOLT 7 hostnames.
16 public class Hostname : CommonBase {
17 internal Hostname(object _dummy, long ptr) : base(ptr) { }
19 if (ptr != 0) { bindings.Hostname_free(ptr); }
22 internal long clone_ptr() {
23 long ret = bindings.Hostname_clone_ptr(this.ptr);
29 * Creates a copy of the Hostname
31 public Hostname clone() {
32 long ret = bindings.Hostname_clone(this.ptr);
34 if (ret >= 0 && ret <= 4096) { return null; }
35 org.ldk.structs.Hostname ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Hostname(null, ret); }
36 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
41 * Checks if two Hostnames contain equal inner contents.
42 * This ignores pointers and is_owned flags and looks at the values in fields.
43 * Two objects with NULL inner values will be considered "equal" here.
45 public bool eq(org.ldk.structs.Hostname b) {
46 bool ret = bindings.Hostname_eq(this.ptr, b == null ? 0 : b.ptr);
49 if (this != null) { this.ptrs_to.AddLast(b); };
53 public override bool Equals(object o) {
54 if (!(o is Hostname)) return false;
55 return this.eq((Hostname)o);
58 * Returns the length of the hostname.
61 byte ret = bindings.Hostname_len(this.ptr);