+ public @NonNull Optional<Revision> getRevision() {
+ return Optional.ofNullable(revision);
+ }
+
+ @Override
+ @SuppressWarnings("checkstyle:parameterName")
+ public int compareTo(final QNameModule o) {
+ int cmp = namespace.compareTo(o.namespace);
+ if (cmp != 0) {
+ return cmp;
+ }
+ return Revision.compare(revision, o.revision);
+ }
+
+ /**
+ * Returns a QNameModule with the same namespace, but with no revision. If this QNameModule does not have
+ * a revision, this object is returned.
+ *
+ * @return a QNameModule with the same namespace, but with no revision.
+ */
+ public @NonNull QNameModule withoutRevision() {
+ return revision == null ? this : new QNameModule(namespace, null);
+ }
+
+ @Override
+ public void writeTo(final DataOutput out) throws IOException {
+ out.writeUTF(namespace.toString());
+ out.writeUTF(revision == null ? "" : revision.toString());