1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
8 public class Result_NoneSemanticErrorZ extends CommonBase {
9 private Result_NoneSemanticErrorZ(Object _dummy, long ptr) { super(ptr); }
10 protected void finalize() throws Throwable {
11 if (ptr != 0) { bindings.CResult_NoneSemanticErrorZ_free(ptr); } super.finalize();
14 static Result_NoneSemanticErrorZ constr_from_ptr(long ptr) {
15 if (bindings.LDKCResult_NoneSemanticErrorZ_result_ok(ptr)) {
16 return new Result_NoneSemanticErrorZ_OK(null, ptr);
18 return new Result_NoneSemanticErrorZ_Err(null, ptr);
21 public static final class Result_NoneSemanticErrorZ_OK extends Result_NoneSemanticErrorZ {
22 private Result_NoneSemanticErrorZ_OK(Object _dummy, long ptr) {
27 public static final class Result_NoneSemanticErrorZ_Err extends Result_NoneSemanticErrorZ {
28 public final SemanticError err;
29 private Result_NoneSemanticErrorZ_Err(Object _dummy, long ptr) {
31 this.err = bindings.LDKCResult_NoneSemanticErrorZ_get_err(ptr);
36 * Creates a new CResult_NoneSemanticErrorZ in the success state.
38 public static Result_NoneSemanticErrorZ ok() {
39 long ret = bindings.CResult_NoneSemanticErrorZ_ok();
40 if (ret < 1024) { return null; }
41 Result_NoneSemanticErrorZ ret_hu_conv = Result_NoneSemanticErrorZ.constr_from_ptr(ret);
46 * Creates a new CResult_NoneSemanticErrorZ in the error state.
48 public static Result_NoneSemanticErrorZ err(SemanticError e) {
49 long ret = bindings.CResult_NoneSemanticErrorZ_err(e);
50 if (ret < 1024) { return null; }
51 Result_NoneSemanticErrorZ ret_hu_conv = Result_NoneSemanticErrorZ.constr_from_ptr(ret);
56 * Creates a new CResult_NoneSemanticErrorZ which has the same data as `orig`
57 * but with all dynamically-allocated buffers duplicated in new buffers.
59 public Result_NoneSemanticErrorZ clone() {
60 long ret = bindings.CResult_NoneSemanticErrorZ_clone(this.ptr);
61 if (ret < 1024) { return null; }
62 Result_NoneSemanticErrorZ ret_hu_conv = Result_NoneSemanticErrorZ.constr_from_ptr(ret);