Merge pull request #5 from TheBlueMatt/main
[ldk-java] / src / main / java / org / ldk / structs / EventsProvider.java
index f7218d2b1e63a70b92d0b54aafda2c6bc38d54a7..837140207330975af4b0fe280f88b260daa40d57 100644 (file)
@@ -5,6 +5,9 @@ import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
 
+/**
+ * A trait indicating an object may generate events
+ */
 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
 public class EventsProvider extends CommonBase {
        final bindings.LDKEventsProvider bindings_instance;
@@ -20,6 +23,10 @@ public class EventsProvider extends CommonBase {
        }
 
        public static interface EventsProviderInterface {
+               /**
+                * Gets the list of pending events which were generated by previous actions, clearing the list
+                * in the process.
+                */
                Event[] get_and_clear_pending_events();
        }
        private static class LDKEventsProviderHolder { EventsProvider held; }
@@ -28,23 +35,27 @@ public class EventsProvider extends CommonBase {
                impl_holder.held = new EventsProvider(new bindings.LDKEventsProvider() {
                        @Override public long[] get_and_clear_pending_events() {
                                Event[] ret = arg.get_and_clear_pending_events();
-                               long[] result = Arrays.stream(ret).mapToLong(arr_conv_7 -> arr_conv_7.ptr).toArray();
+                               long[] result = Arrays.stream(ret).mapToLong(ret_conv_7 -> ret_conv_7.ptr).toArray();
                                /* TODO 2 Event  */;
                                return result;
                        }
                });
                return impl_holder.held;
        }
+       /**
+        * Gets the list of pending events which were generated by previous actions, clearing the list
+        * in the process.
+        */
        public Event[] get_and_clear_pending_events() {
                long[] ret = bindings.EventsProvider_get_and_clear_pending_events(this.ptr);
-               Event[] arr_conv_7_arr = new Event[ret.length];
+               Event[] ret_conv_7_arr = new Event[ret.length];
                for (int h = 0; h < ret.length; h++) {
-                       long arr_conv_7 = ret[h];
-                       Event arr_conv_7_hu_conv = Event.constr_from_ptr(arr_conv_7);
-                       arr_conv_7_hu_conv.ptrs_to.add(this);
-                       arr_conv_7_arr[h] = arr_conv_7_hu_conv;
+                       long ret_conv_7 = ret[h];
+                       Event ret_conv_7_hu_conv = Event.constr_from_ptr(ret_conv_7);
+                       ret_conv_7_hu_conv.ptrs_to.add(this);
+                       ret_conv_7_arr[h] = ret_conv_7_hu_conv;
                }
-               return arr_conv_7_arr;
+               return ret_conv_7_arr;
        }
 
 }