+
+ /**
+ * COmpare two name version implementation objects.
+ *
+ * @param left the left name/version implementation
+ * @param right the right name/version implementation
+ * @return the comparison resilt
+ */
+ public default int compareNameVersion(final PfNameVersion left, final PfNameVersion right) {
+ if (left == null && right == null) {
+ return 0;
+ }
+
+ if (left == null) {
+ return 1;
+ }
+
+ if (right == null) {
+ return -1;
+ }
+
+ int result = ObjectUtils.compare(left.getName(), right.getName());
+ if (result != 0) {
+ return result;
+ }
+
+ if (left.getVersion() == null && right.getVersion() == null) {
+ return 0;
+ }
+
+ if (left.getVersion() == null) {
+ return 1;
+ }
+
+ if (right.getVersion() == null) {
+ return -1;
+ }
+ return new Version(left.getVersion()).compareTo(new Version(right.getVersion()));
+ }