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 {
}
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);
*/
public static Result_StringErrorZ ok(java.lang.String o) {
long ret = bindings.CResult_StringErrorZ_ok(o);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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;
}
*/
public static Result_StringErrorZ err(org.ldk.enums.Secp256k1Error e) {
long ret = bindings.CResult_StringErrorZ_err(e);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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;
+ }
+
}