@Override public boolean equals(Object object) { return (object instanceof Version && compareTo((Version)object) == 0); }
/** * Added so that any unexpected version string formats that might cause an error * will not also cause the application to fail to start. * * @param versionString A potential version string to parse/decode. * @return The parsed version information (if possible), or an empty version * (that will look like: "0.0.0_00") if there was a parsing problem of any kind. */ private static Version safelyDecodeVersion(String versionString) { if (versionString != null && !versionString.isEmpty()) { try { return Version.decode(versionString); } catch (Throwable ex) { String msg = ex.getMessage(); String exMsg = (msg == null || msg.isEmpty()) ? ex.getClass().getSimpleName() : msg; System.err.println("Error decoding version string \"" + versionString + "\": " + exMsg); } } return new Version(0, 0, 0, 0); }
version = new Version(majorRevision, minorRevision, maintenanceRevision, updateRevision, build);
version = new Version(majorRevision, minorRevision, maintenanceRevision, updateRevision, build);
@Override public int hashCode() { return getNumber(); }
@Override public boolean equals(Object object) { return (object instanceof Version && compareTo((Version)object) == 0); }
@Override public int hashCode() { return new Long(getNumber()).hashCode(); }