@Test public void checkIsBackwardCompatible() { SimpleVersion version = new SimpleVersion(1, 1); assertTrue(version.isBackwardCompatible(new SimpleVersion(1, null))); assertFalse(version.isBackwardCompatible(new SimpleVersion(0, 3))); assertFalse(version.isBackwardCompatible(new SimpleVersion(1, 3))); assertFalse(version.isBackwardCompatible(new SimpleVersion(1, 9))); assertFalse(version.isBackwardCompatible(new SimpleVersion(2,null))); version = new SimpleVersion(1, null); assertTrue(version.isBackwardCompatible(new SimpleVersion(1, null))); assertTrue(version.isBackwardCompatible(new SimpleVersion(1, 1))); }
public boolean isBackwardCompatible(final SimpleVersion version) { return major.equals(version.major) && this.compareTo(version) >= 0; }
SimpleVersion implements Comparable<SimpleVersion>, Serializable { public boolean isBackwardCompatible(final SimpleVersion version) { return major.equals(version.major) && this.compareTo(version) >= 0; } }
SimpleVersion implements Comparable<SimpleVersion>, Serializable { public boolean isBackwardCompatible(final SimpleVersion version) { return major.equals(version.major) && this.compareTo(version) >= 0; } SimpleVersion(final Integer major, final Integer medium); }
SimpleVersion implements Comparable<SimpleVersion>, Serializable { public boolean isBackwardCompatible(final SimpleVersion version) { return major.equals(version.major) && this.compareTo(version) >= 0; } SimpleVersion(final Integer major, final Integer medium); final static SimpleVersion parse(final String version); static boolean isCompatible(final String minimalJvmVersion); static String getCurrentJavaVirtualMachineSpecificationVersion(); int compareTo(final SimpleVersion version); boolean isBackwardCompatible(final SimpleVersion version); Integer getMajor(); Integer getMedium(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); }
SimpleVersion implements Comparable<SimpleVersion>, Serializable { public boolean isBackwardCompatible(final SimpleVersion version) { return major.equals(version.major) && this.compareTo(version) >= 0; } SimpleVersion(final Integer major, final Integer medium); final static SimpleVersion parse(final String version); static boolean isCompatible(final String minimalJvmVersion); static String getCurrentJavaVirtualMachineSpecificationVersion(); int compareTo(final SimpleVersion version); boolean isBackwardCompatible(final SimpleVersion version); Integer getMajor(); Integer getMedium(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }