[Java] Update auto-generated Java bindings to LDK 0.0.110
[ldk-java] / src / main / java / org / ldk / structs / Hostname.java
1 package org.ldk.structs;
2
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
5 import org.ldk.util.*;
6 import java.util.Arrays;
7 import java.lang.ref.Reference;
8 import javax.annotation.Nullable;
9
10
11 /**
12  * Represents a hostname for serialization purposes.
13  * Only the character set and length will be validated.
14  * The character set consists of ASCII alphanumeric characters, hyphens, and periods.
15  * Its length is guaranteed to be representable by a single byte.
16  * This serialization is used by BOLT 7 hostnames.
17  */
18 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
19 public class Hostname extends CommonBase {
20         Hostname(Object _dummy, long ptr) { super(ptr); }
21         @Override @SuppressWarnings("deprecation")
22         protected void finalize() throws Throwable {
23                 super.finalize();
24                 if (ptr != 0) { bindings.Hostname_free(ptr); }
25         }
26
27         long clone_ptr() {
28                 long ret = bindings.Hostname_clone_ptr(this.ptr);
29                 Reference.reachabilityFence(this);
30                 return ret;
31         }
32
33         /**
34          * Creates a copy of the Hostname
35          */
36         public Hostname clone() {
37                 long ret = bindings.Hostname_clone(this.ptr);
38                 Reference.reachabilityFence(this);
39                 if (ret >= 0 && ret <= 4096) { return null; }
40                 org.ldk.structs.Hostname ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Hostname(null, ret); }
41                 ret_hu_conv.ptrs_to.add(this);
42                 return ret_hu_conv;
43         }
44
45         /**
46          * Returns the length of the hostname.
47          */
48         public byte len() {
49                 byte ret = bindings.Hostname_len(this.ptr);
50                 Reference.reachabilityFence(this);
51                 return ret;
52         }
53
54 }