+ long clone_ptr() {
+ long ret = bindings.Event_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
+ /**
+ * Creates a copy of the Event
+ */
+ public Event clone() {
+ long ret = bindings.Event_clone(this.ptr);
+ Reference.reachabilityFence(this);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Event ret_hu_conv = Event.constr_from_ptr(ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Utility method to constructs a new FundingGenerationReady-variant Event
+ */
+ public static Event funding_generation_ready(byte[] temporary_channel_id, long channel_value_satoshis, byte[] output_script, long user_channel_id) {
+ long ret = bindings.Event_funding_generation_ready(InternalUtils.check_arr_len(temporary_channel_id, 32), channel_value_satoshis, output_script, user_channel_id);
+ Reference.reachabilityFence(temporary_channel_id);
+ Reference.reachabilityFence(channel_value_satoshis);
+ Reference.reachabilityFence(output_script);
+ Reference.reachabilityFence(user_channel_id);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Event ret_hu_conv = Event.constr_from_ptr(ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Utility method to constructs a new PaymentReceived-variant Event
+ */
+ public static Event payment_received(byte[] payment_hash, long amt, PaymentPurpose purpose) {
+ long ret = bindings.Event_payment_received(InternalUtils.check_arr_len(payment_hash, 32), amt, purpose.ptr);
+ Reference.reachabilityFence(payment_hash);
+ Reference.reachabilityFence(amt);
+ Reference.reachabilityFence(purpose);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Event ret_hu_conv = Event.constr_from_ptr(ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Utility method to constructs a new PaymentSent-variant Event
+ */
+ public static Event payment_sent(byte[] payment_id, byte[] payment_preimage, byte[] payment_hash, Option_u64Z fee_paid_msat) {
+ long ret = bindings.Event_payment_sent(InternalUtils.check_arr_len(payment_id, 32), InternalUtils.check_arr_len(payment_preimage, 32), InternalUtils.check_arr_len(payment_hash, 32), fee_paid_msat.ptr);
+ Reference.reachabilityFence(payment_id);
+ Reference.reachabilityFence(payment_preimage);
+ Reference.reachabilityFence(payment_hash);
+ Reference.reachabilityFence(fee_paid_msat);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Event ret_hu_conv = Event.constr_from_ptr(ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Utility method to constructs a new PaymentPathFailed-variant Event
+ */
+ public static Event payment_path_failed(byte[] payment_id, byte[] payment_hash, boolean rejected_by_dest, Option_NetworkUpdateZ network_update, boolean all_paths_failed, RouteHop[] path, Option_u64Z short_channel_id, RouteParameters retry) {
+ long ret = bindings.Event_payment_path_failed(InternalUtils.check_arr_len(payment_id, 32), InternalUtils.check_arr_len(payment_hash, 32), rejected_by_dest, network_update.ptr, all_paths_failed, path != null ? Arrays.stream(path).mapToLong(path_conv_10 -> path_conv_10 == null ? 0 : path_conv_10.ptr & ~1).toArray() : null, short_channel_id.ptr, retry == null ? 0 : retry.ptr & ~1);
+ Reference.reachabilityFence(payment_id);
+ Reference.reachabilityFence(payment_hash);
+ Reference.reachabilityFence(rejected_by_dest);
+ Reference.reachabilityFence(network_update);
+ Reference.reachabilityFence(all_paths_failed);
+ Reference.reachabilityFence(path);
+ Reference.reachabilityFence(short_channel_id);
+ Reference.reachabilityFence(retry);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Event ret_hu_conv = Event.constr_from_ptr(ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Utility method to constructs a new PaymentFailed-variant Event
+ */
+ public static Event payment_failed(byte[] payment_id, byte[] payment_hash) {
+ long ret = bindings.Event_payment_failed(InternalUtils.check_arr_len(payment_id, 32), InternalUtils.check_arr_len(payment_hash, 32));
+ Reference.reachabilityFence(payment_id);
+ Reference.reachabilityFence(payment_hash);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Event ret_hu_conv = Event.constr_from_ptr(ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Utility method to constructs a new PendingHTLCsForwardable-variant Event
+ */
+ public static Event pending_htlcs_forwardable(long time_forwardable) {
+ long ret = bindings.Event_pending_htlcs_forwardable(time_forwardable);
+ Reference.reachabilityFence(time_forwardable);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Event ret_hu_conv = Event.constr_from_ptr(ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Utility method to constructs a new SpendableOutputs-variant Event
+ */
+ public static Event spendable_outputs(SpendableOutputDescriptor[] outputs) {
+ long ret = bindings.Event_spendable_outputs(outputs != null ? Arrays.stream(outputs).mapToLong(outputs_conv_27 -> outputs_conv_27.ptr).toArray() : null);
+ Reference.reachabilityFence(outputs);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Event ret_hu_conv = Event.constr_from_ptr(ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Utility method to constructs a new PaymentForwarded-variant Event
+ */
+ public static Event payment_forwarded(Option_u64Z fee_earned_msat, boolean claim_from_onchain_tx) {
+ long ret = bindings.Event_payment_forwarded(fee_earned_msat.ptr, claim_from_onchain_tx);
+ Reference.reachabilityFence(fee_earned_msat);
+ Reference.reachabilityFence(claim_from_onchain_tx);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Event ret_hu_conv = Event.constr_from_ptr(ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Utility method to constructs a new ChannelClosed-variant Event
+ */
+ public static Event channel_closed(byte[] channel_id, long user_channel_id, ClosureReason reason) {
+ long ret = bindings.Event_channel_closed(InternalUtils.check_arr_len(channel_id, 32), user_channel_id, reason.ptr);
+ Reference.reachabilityFence(channel_id);
+ Reference.reachabilityFence(user_channel_id);
+ Reference.reachabilityFence(reason);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Event ret_hu_conv = Event.constr_from_ptr(ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Utility method to constructs a new DiscardFunding-variant Event
+ */
+ public static Event discard_funding(byte[] channel_id, byte[] transaction) {
+ long ret = bindings.Event_discard_funding(InternalUtils.check_arr_len(channel_id, 32), transaction);
+ Reference.reachabilityFence(channel_id);
+ Reference.reachabilityFence(transaction);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Event ret_hu_conv = Event.constr_from_ptr(ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Utility method to constructs a new PaymentPathSuccessful-variant Event
+ */
+ public static Event payment_path_successful(byte[] payment_id, byte[] payment_hash, RouteHop[] path) {
+ long ret = bindings.Event_payment_path_successful(InternalUtils.check_arr_len(payment_id, 32), InternalUtils.check_arr_len(payment_hash, 32), path != null ? Arrays.stream(path).mapToLong(path_conv_10 -> path_conv_10 == null ? 0 : path_conv_10.ptr & ~1).toArray() : null);
+ Reference.reachabilityFence(payment_id);
+ Reference.reachabilityFence(payment_hash);
+ Reference.reachabilityFence(path);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Event ret_hu_conv = Event.constr_from_ptr(ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Utility method to constructs a new OpenChannelRequest-variant Event
+ */
+ public static Event open_channel_request(byte[] temporary_channel_id, byte[] counterparty_node_id, long funding_satoshis, long push_msat) {
+ long ret = bindings.Event_open_channel_request(InternalUtils.check_arr_len(temporary_channel_id, 32), InternalUtils.check_arr_len(counterparty_node_id, 33), funding_satoshis, push_msat);
+ Reference.reachabilityFence(temporary_channel_id);
+ Reference.reachabilityFence(counterparty_node_id);
+ Reference.reachabilityFence(funding_satoshis);
+ Reference.reachabilityFence(push_msat);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Event ret_hu_conv = Event.constr_from_ptr(ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Serialize the Event object into a byte array which can be read by Event_read
+ */
+ public byte[] write() {
+ byte[] ret = bindings.Event_write(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+