+ /**
+ * Utility method to constructs a new UnknownVersion-variant DecodeError
+ */
+ public static DecodeError unknown_version() {
+ long ret = bindings.DecodeError_unknown_version();
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.DecodeError ret_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(ret);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
+ return ret_hu_conv;
+ }
+
+ /**
+ * Utility method to constructs a new UnknownRequiredFeature-variant DecodeError
+ */
+ public static DecodeError unknown_required_feature() {
+ long ret = bindings.DecodeError_unknown_required_feature();
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.DecodeError ret_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(ret);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
+ return ret_hu_conv;
+ }
+
+ /**
+ * Utility method to constructs a new InvalidValue-variant DecodeError
+ */
+ public static DecodeError invalid_value() {
+ long ret = bindings.DecodeError_invalid_value();
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.DecodeError ret_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(ret);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
+ return ret_hu_conv;
+ }
+
+ /**
+ * Utility method to constructs a new ShortRead-variant DecodeError
+ */
+ public static DecodeError short_read() {
+ long ret = bindings.DecodeError_short_read();
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.DecodeError ret_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(ret);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
+ return ret_hu_conv;
+ }
+
+ /**
+ * Utility method to constructs a new BadLengthDescriptor-variant DecodeError
+ */
+ public static DecodeError bad_length_descriptor() {
+ long ret = bindings.DecodeError_bad_length_descriptor();
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.DecodeError ret_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(ret);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
+ return ret_hu_conv;
+ }
+
+ /**
+ * Utility method to constructs a new Io-variant DecodeError
+ */
+ public static DecodeError io(org.ldk.enums.IOError a) {
+ long ret = bindings.DecodeError_io(a);
+ Reference.reachabilityFence(a);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.DecodeError ret_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(ret);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
+ return ret_hu_conv;
+ }
+
+ /**
+ * Utility method to constructs a new UnsupportedCompression-variant DecodeError
+ */
+ public static DecodeError unsupported_compression() {
+ long ret = bindings.DecodeError_unsupported_compression();
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.DecodeError ret_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(ret);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
+ return ret_hu_conv;
+ }
+
+ /**
+ * Checks if two DecodeErrors contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ */
+ public boolean eq(DecodeError b) {
+ boolean ret = bindings.DecodeError_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof DecodeError)) return false;
+ return this.eq((DecodeError)o);
+ }