]> git.bitcoin.ninja Git - ldk-java/blob - ts/structs/PositiveTimestamp.ts
Update auto-updated Java files
[ldk-java] / ts / structs / PositiveTimestamp.ts
1
2             
3 import CommonBase from './CommonBase';
4 import * as bindings from '../bindings' // TODO: figure out location
5
6
7
8             export default class PositiveTimestamp extends CommonBase {
9                 constructor(_dummy: object, ptr: number) {
10                     super(ptr);
11                 }
12
13                 
14                 protected finalize() {
15                     super.finalize();
16
17                     if (this.ptr != 0) {
18                         bindings.PositiveTimestamp_free(this.ptr);
19                     }
20                 }
21         public boolean eq(PositiveTimestamp b) {
22                 boolean ret = bindings.PositiveTimestamp_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
23                 this.ptrs_to.add(b);
24                 return ret;
25         }
26
27         public number clone_ptr() {
28                 number ret = bindings.PositiveTimestamp_clone_ptr(this.ptr);
29                 return ret;
30         }
31
32         public PositiveTimestamp clone() {
33                 number ret = bindings.PositiveTimestamp_clone(this.ptr);
34                 const ret_hu_conv: PositiveTimestamp = new PositiveTimestamp(null, ret);
35                 ret_hu_conv.ptrs_to.add(this);
36                 return ret_hu_conv;
37         }
38
39         public static Result_PositiveTimestampCreationErrorZ constructor_from_unix_timestamp(number unix_seconds) {
40                 number ret = bindings.PositiveTimestamp_from_unix_timestamp(unix_seconds);
41                 Result_PositiveTimestampCreationErrorZ ret_hu_conv = Result_PositiveTimestampCreationErrorZ.constr_from_ptr(ret);
42                 return ret_hu_conv;
43         }
44
45         public static Result_PositiveTimestampCreationErrorZ constructor_from_system_time(number time) {
46                 number ret = bindings.PositiveTimestamp_from_system_time(time);
47                 Result_PositiveTimestampCreationErrorZ ret_hu_conv = Result_PositiveTimestampCreationErrorZ.constr_from_ptr(ret);
48                 return ret_hu_conv;
49         }
50
51         public number as_unix_timestamp() {
52                 number ret = bindings.PositiveTimestamp_as_unix_timestamp(this.ptr);
53                 return ret;
54         }
55
56         public number as_time() {
57                 number ret = bindings.PositiveTimestamp_as_time(this.ptr);
58                 return ret;
59         }
60
61 }