1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
7 import javax.annotation.Nullable;
9 public class Result_NoneSemanticErrorZ extends CommonBase {
10 private Result_NoneSemanticErrorZ(Object _dummy, long ptr) { super(ptr); }
11 protected void finalize() throws Throwable {
12 if (ptr != 0) { bindings.CResult_NoneSemanticErrorZ_free(ptr); } super.finalize();
15 static Result_NoneSemanticErrorZ constr_from_ptr(long ptr) {
16 if (bindings.LDKCResult_NoneSemanticErrorZ_result_ok(ptr)) {
17 return new Result_NoneSemanticErrorZ_OK(null, ptr);
19 return new Result_NoneSemanticErrorZ_Err(null, ptr);
22 public static final class Result_NoneSemanticErrorZ_OK extends Result_NoneSemanticErrorZ {
23 private Result_NoneSemanticErrorZ_OK(Object _dummy, long ptr) {
28 public static final class Result_NoneSemanticErrorZ_Err extends Result_NoneSemanticErrorZ {
29 public final SemanticError err;
30 private Result_NoneSemanticErrorZ_Err(Object _dummy, long ptr) {
32 this.err = bindings.LDKCResult_NoneSemanticErrorZ_get_err(ptr);
37 * Creates a new CResult_NoneSemanticErrorZ in the success state.
39 public static Result_NoneSemanticErrorZ ok() {
40 long ret = bindings.CResult_NoneSemanticErrorZ_ok();
41 if (ret < 1024) { return null; }
42 Result_NoneSemanticErrorZ ret_hu_conv = Result_NoneSemanticErrorZ.constr_from_ptr(ret);
47 * Creates a new CResult_NoneSemanticErrorZ in the error state.
49 public static Result_NoneSemanticErrorZ err(org.ldk.enums.SemanticError e) {
50 long ret = bindings.CResult_NoneSemanticErrorZ_err(e);
51 if (ret < 1024) { return null; }
52 Result_NoneSemanticErrorZ ret_hu_conv = Result_NoneSemanticErrorZ.constr_from_ptr(ret);
57 * Creates a new CResult_NoneSemanticErrorZ which has the same data as `orig`
58 * but with all dynamically-allocated buffers duplicated in new buffers.
60 public Result_NoneSemanticErrorZ clone() {
61 long ret = bindings.CResult_NoneSemanticErrorZ_clone(this.ptr);
62 if (ret < 1024) { return null; }
63 Result_NoneSemanticErrorZ ret_hu_conv = Result_NoneSemanticErrorZ.constr_from_ptr(ret);