3 import CommonBase from './CommonBase';
4 import * as bindings from '../bindings' // TODO: figure out location
8 export default class Route extends CommonBase {
9 constructor(_dummy: object, ptr: number) {
14 protected finalize() {
18 bindings.Route_free(this.ptr);
21 public Route clone() {
22 number ret = bindings.Route_clone(this.ptr);
23 const ret_hu_conv: Route = new Route(null, ret);
24 ret_hu_conv.ptrs_to.add(this);
28 public void set_paths(RouteHop[][] val) {
29 bindings.Route_set_paths(this.ptr, (number[][])Arrays.stream(val).map(arr_conv_12 -> (number[])Arrays.stream(arr_conv_12).map(arr_conv_10 -> arr_conv_10 == null ? 0 : arr_conv_10.ptr & ~1).toArray()).toArray());
30 /* TODO 2 RouteHop[] */;
33 public static Route constructor_new(RouteHop[][] paths_arg) {
34 number ret = bindings.Route_new((number[][])Arrays.stream(paths_arg).map(arr_conv_12 -> (number[])Arrays.stream(arr_conv_12).map(arr_conv_10 -> arr_conv_10 == null ? 0 : arr_conv_10.ptr & ~1).toArray()).toArray());
35 const ret_hu_conv: Route = new Route(null, ret);
36 ret_hu_conv.ptrs_to.add(ret_hu_conv);
37 /* TODO 2 RouteHop[] */;
41 public Uint8Array write() {
42 Uint8Array ret = bindings.Route_write(this.ptr);
46 public static Result_RouteDecodeErrorZ constructor_read(Uint8Array ser) {
47 number ret = bindings.Route_read(ser);
48 Result_RouteDecodeErrorZ ret_hu_conv = Result_RouteDecodeErrorZ.constr_from_ptr(ret);