1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
7 import java.lang.ref.Reference;
8 import javax.annotation.Nullable;
10 public class Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ extends CommonBase {
11 private Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ(Object _dummy, long ptr) { super(ptr); }
12 protected void finalize() throws Throwable {
13 if (ptr != 0) { bindings.CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_free(ptr); } super.finalize();
16 protected void force_free() {
17 if (ptr != 0) { bindings.CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_free(ptr); ptr = 0; }
20 static Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ constr_from_ptr(long ptr) {
21 if (bindings.CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_is_ok(ptr)) {
22 return new Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_OK(null, ptr);
24 return new Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_Err(null, ptr);
27 public static final class Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_OK extends Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ {
28 public final TwoTuple_BlindedPayInfoBlindedPathZ res;
29 private Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_OK(Object _dummy, long ptr) {
31 long res = bindings.CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_get_ok(ptr);
32 TwoTuple_BlindedPayInfoBlindedPathZ res_hu_conv = new TwoTuple_BlindedPayInfoBlindedPathZ(null, res);
33 if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); };
34 this.res = res_hu_conv;
38 public static final class Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_Err extends Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ {
39 private Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_Err(Object _dummy, long ptr) {
45 * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ in the success state.
47 public static Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ ok(org.ldk.structs.TwoTuple_BlindedPayInfoBlindedPathZ o) {
48 long ret = bindings.CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_ok(o.ptr);
49 Reference.reachabilityFence(o);
50 if (ret >= 0 && ret <= 4096) { return null; }
51 Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ ret_hu_conv = Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ.constr_from_ptr(ret);
56 * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ in the error state.
58 public static Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ err() {
59 long ret = bindings.CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_err();
60 if (ret >= 0 && ret <= 4096) { return null; }
61 Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ ret_hu_conv = Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ.constr_from_ptr(ret);
66 * Checks if the given object is currently in the success state
68 public boolean is_ok() {
69 boolean ret = bindings.CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_is_ok(this.ptr);
70 Reference.reachabilityFence(this);
75 long ret = bindings.CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone_ptr(this.ptr);
76 Reference.reachabilityFence(this);
81 * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ which has the same data as `orig`
82 * but with all dynamically-allocated buffers duplicated in new buffers.
84 public Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ clone() {
85 long ret = bindings.CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone(this.ptr);
86 Reference.reachabilityFence(this);
87 if (ret >= 0 && ret <= 4096) { return null; }
88 Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ ret_hu_conv = Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ.constr_from_ptr(ret);