- public void set_byteslen(Pong this_ptr, short val) {
- bindings.Pong_set_byteslen(this_ptr.ptr & ~1, val);
- this.ptrs_to.add(this_ptr);
+ /**
+ * Creates a copy of the Pong
+ */
+ public Pong clone() {
+ long ret = bindings.Pong_clone(this.ptr);
+ Reference.reachabilityFence(this);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.Pong ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Pong(null, ret); }
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
+ return ret_hu_conv;
+ }
+
+ /**
+ * Generates a non-cryptographic 64-bit hash of the Pong.
+ */
+ public long hash() {
+ long ret = bindings.Pong_hash(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
+ @Override public int hashCode() {
+ return (int)this.hash();
+ }
+ /**
+ * Checks if two Pongs contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(org.ldk.structs.Pong b) {
+ boolean ret = bindings.Pong_eq(this.ptr, b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof Pong)) return false;
+ return this.eq((Pong)o);
+ }
+ /**
+ * Serialize the Pong object into a byte array which can be read by Pong_read
+ */
+ public byte[] write() {
+ byte[] ret = bindings.Pong_write(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;