Update auto-generated bindings to 0.0.103
[ldk-java] / src / main / java / org / ldk / structs / Sha256.java
1 package org.ldk.structs;
2
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
5 import org.ldk.util.*;
6 import java.util.Arrays;
7 import javax.annotation.Nullable;
8
9
10 /**
11  * SHA-256 hash
12  */
13 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
14 public class Sha256 extends CommonBase {
15         Sha256(Object _dummy, long ptr) { super(ptr); }
16         @Override @SuppressWarnings("deprecation")
17         protected void finalize() throws Throwable {
18                 super.finalize();
19                 if (ptr != 0) { bindings.Sha256_free(ptr); }
20         }
21
22         /**
23          * Creates a copy of the Sha256
24          */
25         public Sha256 clone() {
26                 long ret = bindings.Sha256_clone(this.ptr);
27                 if (ret >= 0 && ret <= 4096) { return null; }
28                 Sha256 ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Sha256(null, ret); }
29                 ret_hu_conv.ptrs_to.add(this);
30                 return ret_hu_conv;
31         }
32
33         /**
34          * Checks if two Sha256s contain equal inner contents.
35          */
36         public long hash() {
37                 long ret = bindings.Sha256_hash(this.ptr);
38                 return ret;
39         }
40
41         /**
42          * Checks if two Sha256s contain equal inner contents.
43          * This ignores pointers and is_owned flags and looks at the values in fields.
44          * Two objects with NULL inner values will be considered "equal" here.
45          */
46         public boolean eq(Sha256 b) {
47                 boolean ret = bindings.Sha256_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
48                 this.ptrs_to.add(b);
49                 return ret;
50         }
51
52 }