/** * Returns the major version number. This method returns an {@link Integer} if possible, or a * {@link String} otherwise. * * @return The major version number. */ public Comparable<?> getMajor() { return getComponent(0); }
/** * Returns the revision number. This method returns an {@link Integer} if possible, or a {@link * String} otherwise. If there is no revision number, then this method returns {@code null}. * * @return The revision number, or {@code null} if none. */ public Comparable<?> getRevision() { return getComponent(2); }
/** * Returns the minor version number. This method returns an {@link Integer} if possible, or a * {@link String} otherwise. If there is no minor version number, then this method returns * {@code null}. * * @return The minor version number, or {@code null} if none. */ public Comparable<?> getMinor() { return getComponent(1); }
/** Returns a hash code value for this version. */ @Override public int hashCode() { if (hashCode == 0) { int code = (int) serialVersionUID; int index = 0; Comparable<?> component; while ((component = getComponent(index)) != null) { code = code * 37 + component.hashCode(); index++; } hashCode = code; } return hashCode; } }
final Comparable<?> v1 = this.getComponent(i); final Comparable<?> v2 = other.getComponent(i); if (v1 == null) { return (v2 == null) ? 0 : -1;
/** * Returns the minor version number. This method returns an {@link Integer} if possible, * or a {@link String} otherwise. If there is no minor version number, then this method * returns {@code null}. * * @return The minor version number, or {@code null} if none. */ public Comparable<?> getMinor() { return getComponent(1); }
/** * Returns the minor version number. This method returns an {@link Integer} if possible, * or a {@link String} otherwise. If there is no minor version number, then this method * returns {@code null}. */ public Comparable getMinor() { return getComponent(1); }
/** * Returns the major version number. This method returns an {@link Integer} if possible, * or a {@link String} otherwise. * * @return The major version number. */ public Comparable<?> getMajor() { return getComponent(0); }
/** * Returns the major version number. This method returns an {@link Integer} if possible, * or a {@link String} otherwise. */ public Comparable getMajor() { return getComponent(0); }
/** * Returns the revision number. This method returns an {@link Integer} if possible, * or a {@link String} otherwise. If there is no revision number, then this method * returns {@code null}. * * @return The revision number, or {@code null} if none. */ public Comparable<?> getRevision() { return getComponent(2); }
/** * Returns the revision number. This method returns an {@link Integer} if possible, * or a {@link String} otherwise. If there is no revision number, then this method * returns {@code null}. */ public Comparable getRevision() { return getComponent(2); }
/** * Returns a hash code value for this version. */ public int hashCode() { if (hashCode == 0) { int code = (int)serialVersionUID; int index = 0; Comparable component; while ((component = getComponent(index)) != null) { code = code * 37 + component.hashCode(); index++; } hashCode = code; } return hashCode; } }
/** * Returns a hash code value for this version. */ @Override public int hashCode() { if (hashCode == 0) { int code = (int) serialVersionUID; int index = 0; Comparable<?> component; while ((component = getComponent(index)) != null) { code = code * 37 + component.hashCode(); index++; } hashCode = code; } return hashCode; } }
final Comparable v1 = this.getComponent(i); final Comparable v2 = other.getComponent(i); if (v1 == null) { return (v2 == null) ? 0 : -1;
final Comparable<?> v1 = this.getComponent(i); final Comparable<?> v2 = other.getComponent(i); if (v1 == null) { return (v2 == null) ? 0 : -1;