summaryrefslogtreecommitdiffstats
path: root/java/src/hdf/hdf5lib/structs/H5O_token_t.java
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2020-01-16 21:29:34 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2020-01-16 21:29:34 (GMT)
commita92c735c9b57049e8c4037d3490f7e10f8eef4d6 (patch)
tree74da25151de6d1e32329dfcd62e17c863e2e3de1 /java/src/hdf/hdf5lib/structs/H5O_token_t.java
parent024f7ba09250110c19b070c9699cfbc0f9dc2b96 (diff)
downloadhdf5-a92c735c9b57049e8c4037d3490f7e10f8eef4d6.zip
hdf5-a92c735c9b57049e8c4037d3490f7e10f8eef4d6.tar.gz
hdf5-a92c735c9b57049e8c4037d3490f7e10f8eef4d6.tar.bz2
Squashed commit of the token_refactoring branch:
Diffstat (limited to 'java/src/hdf/hdf5lib/structs/H5O_token_t.java')
-rw-r--r--java/src/hdf/hdf5lib/structs/H5O_token_t.java45
1 files changed, 45 insertions, 0 deletions
diff --git a/java/src/hdf/hdf5lib/structs/H5O_token_t.java b/java/src/hdf/hdf5lib/structs/H5O_token_t.java
new file mode 100644
index 0000000..8ec0b7f
--- /dev/null
+++ b/java/src/hdf/hdf5lib/structs/H5O_token_t.java
@@ -0,0 +1,45 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+package hdf.hdf5lib.structs;
+
+import java.io.Serializable;
+import java.util.Arrays;
+
+import hdf.hdf5lib.HDF5Constants;
+
+// Object token, which is a unique and permanent identifier, for an HDF5 object within a container.
+public class H5O_token_t implements Serializable {
+ private static final long serialVersionUID = -4754320605310155032L;
+ public byte[] data;
+
+ H5O_token_t (byte[] data) {
+ this.data = data;
+ }
+
+ public boolean isUndefined() {
+ return this.equals(HDF5Constants.H5O_TOKEN_UNDEF);
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o)
+ return true;
+
+ if (!(o instanceof H5O_token_t))
+ return false;
+
+ H5O_token_t token = (H5O_token_t) o;
+
+ return Arrays.equals(this.data, token.data);
+ }
+} \ No newline at end of file