[Java] Update auto-generated bindings
[ldk-java] / src / main / java / org / ldk / structs / Bech32Error.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 an error returned from the bech32 library during validation of some bech32 data
13  */
14 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
15 public class Bech32Error extends CommonBase {
16         private Bech32Error(Object _dummy, long ptr) { super(ptr); }
17         @Override @SuppressWarnings("deprecation")
18         protected void finalize() throws Throwable {
19                 super.finalize();
20                 if (ptr != 0) { bindings.Bech32Error_free(ptr); }
21         }
22         static Bech32Error constr_from_ptr(long ptr) {
23                 bindings.LDKBech32Error raw_val = bindings.LDKBech32Error_ref_from_ptr(ptr);
24                 if (raw_val.getClass() == bindings.LDKBech32Error.MissingSeparator.class) {
25                         return new MissingSeparator(ptr, (bindings.LDKBech32Error.MissingSeparator)raw_val);
26                 }
27                 if (raw_val.getClass() == bindings.LDKBech32Error.InvalidChecksum.class) {
28                         return new InvalidChecksum(ptr, (bindings.LDKBech32Error.InvalidChecksum)raw_val);
29                 }
30                 if (raw_val.getClass() == bindings.LDKBech32Error.InvalidLength.class) {
31                         return new InvalidLength(ptr, (bindings.LDKBech32Error.InvalidLength)raw_val);
32                 }
33                 if (raw_val.getClass() == bindings.LDKBech32Error.InvalidChar.class) {
34                         return new InvalidChar(ptr, (bindings.LDKBech32Error.InvalidChar)raw_val);
35                 }
36                 if (raw_val.getClass() == bindings.LDKBech32Error.InvalidData.class) {
37                         return new InvalidData(ptr, (bindings.LDKBech32Error.InvalidData)raw_val);
38                 }
39                 if (raw_val.getClass() == bindings.LDKBech32Error.InvalidPadding.class) {
40                         return new InvalidPadding(ptr, (bindings.LDKBech32Error.InvalidPadding)raw_val);
41                 }
42                 if (raw_val.getClass() == bindings.LDKBech32Error.MixedCase.class) {
43                         return new MixedCase(ptr, (bindings.LDKBech32Error.MixedCase)raw_val);
44                 }
45                 assert false; return null; // Unreachable without extending the (internal) bindings interface
46         }
47
48         /**
49          * String does not contain the separator character
50          */
51         public final static class MissingSeparator extends Bech32Error {
52                 private MissingSeparator(long ptr, bindings.LDKBech32Error.MissingSeparator obj) {
53                         super(null, ptr);
54                 }
55         }
56         /**
57          * The checksum does not match the rest of the data
58          */
59         public final static class InvalidChecksum extends Bech32Error {
60                 private InvalidChecksum(long ptr, bindings.LDKBech32Error.InvalidChecksum obj) {
61                         super(null, ptr);
62                 }
63         }
64         /**
65          * The data or human-readable part is too long or too short
66          */
67         public final static class InvalidLength extends Bech32Error {
68                 private InvalidLength(long ptr, bindings.LDKBech32Error.InvalidLength obj) {
69                         super(null, ptr);
70                 }
71         }
72         /**
73          * Some part of the string contains an invalid character
74          */
75         public final static class InvalidChar extends Bech32Error {
76                 public final int invalid_char;
77                 private InvalidChar(long ptr, bindings.LDKBech32Error.InvalidChar obj) {
78                         super(null, ptr);
79                         this.invalid_char = obj.invalid_char;
80                 }
81         }
82         /**
83          * Some part of the data has an invalid value
84          */
85         public final static class InvalidData extends Bech32Error {
86                 public final byte invalid_data;
87                 private InvalidData(long ptr, bindings.LDKBech32Error.InvalidData obj) {
88                         super(null, ptr);
89                         this.invalid_data = obj.invalid_data;
90                 }
91         }
92         /**
93          * The bit conversion failed due to a padding issue
94          */
95         public final static class InvalidPadding extends Bech32Error {
96                 private InvalidPadding(long ptr, bindings.LDKBech32Error.InvalidPadding obj) {
97                         super(null, ptr);
98                 }
99         }
100         /**
101          * The whole string must be of one case
102          */
103         public final static class MixedCase extends Bech32Error {
104                 private MixedCase(long ptr, bindings.LDKBech32Error.MixedCase obj) {
105                         super(null, ptr);
106                 }
107         }
108         long clone_ptr() {
109                 long ret = bindings.Bech32Error_clone_ptr(this.ptr);
110                 Reference.reachabilityFence(this);
111                 return ret;
112         }
113
114         /**
115          * Creates a new Bech32Error which has the same data as `orig`
116          */
117         public Bech32Error clone() {
118                 long ret = bindings.Bech32Error_clone(this.ptr);
119                 Reference.reachabilityFence(this);
120                 if (ret >= 0 && ret <= 4096) { return null; }
121                 org.ldk.structs.Bech32Error ret_hu_conv = org.ldk.structs.Bech32Error.constr_from_ptr(ret);
122                 ret_hu_conv.ptrs_to.add(this);
123                 return ret_hu_conv;
124         }
125
126 }