import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
+import javax.annotation.Nullable;
public class Result_StringErrorZ extends CommonBase {
private Result_StringErrorZ(Object _dummy, long ptr) { super(ptr); }
}
static Result_StringErrorZ constr_from_ptr(long ptr) {
- if (bindings.LDKCResult_StringErrorZ_result_ok(ptr)) {
+ if (bindings.CResult_StringErrorZ_is_ok(ptr)) {
return new Result_StringErrorZ_OK(null, ptr);
} else {
return new Result_StringErrorZ_Err(null, ptr);
/**
* Creates a new CResult_StringErrorZ in the success state.
*/
- public static Result_StringErrorZ ok(String o) {
+ public static Result_StringErrorZ ok(java.lang.String o) {
long ret = bindings.CResult_StringErrorZ_ok(o);
+ Reference.reachabilityFence(o);
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_StringErrorZ ret_hu_conv = Result_StringErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
/**
* Creates a new CResult_StringErrorZ in the error state.
*/
- public static Result_StringErrorZ err(Secp256k1Error e) {
+ public static Result_StringErrorZ err(org.ldk.enums.Secp256k1Error e) {
long ret = bindings.CResult_StringErrorZ_err(e);
+ Reference.reachabilityFence(e);
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_StringErrorZ ret_hu_conv = Result_StringErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
+ /**
+ * Checks if the given object is currently in the success state
+ */
+ public boolean is_ok() {
+ boolean ret = bindings.CResult_StringErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
}