@Test public void upgradeMinorVersionOnClassDeprecated() { validate(singleton(new Delta.Deprecate("class", new ClassInfo(1, 0, "", "", "", null, null, null), new ClassInfo(1, 0, "", "", "", null, null, null))), new Version(1, 1, 0), new Version(1, 2, 0), true); }
public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalArgumentException("Current version <"+previous+"> must be more recent than previous version <"+current+">."); } if (current.isInDevelopment()) { return true; } final Version inferredVersion = infer(previous); return current.toReleaseVersion().compareTo(inferredVersion) >= 0; }
Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalArgumentException("Current version <"+previous+"> must be more recent than previous version <"+current+">."); } if (current.isInDevelopment()) { return true; } final Version inferredVersion = infer(previous); return current.toReleaseVersion().compareTo(inferredVersion) >= 0; } }
Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalArgumentException("Current version <"+previous+"> must be more recent than previous version <"+current+">."); } if (current.isInDevelopment()) { return true; } final Version inferredVersion = infer(previous); return current.toReleaseVersion().compareTo(inferredVersion) >= 0; } Delta(@Nonnull final Set<? extends Difference> differences); }
Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalArgumentException("Current version <"+previous+"> must be more recent than previous version <"+current+">."); } if (current.isInDevelopment()) { return true; } final Version inferredVersion = infer(previous); return current.toReleaseVersion().compareTo(inferredVersion) >= 0; } Delta(@Nonnull final Set<? extends Difference> differences); @Nonnull final Set<Difference> getDifferences(); @Nonnull final CompatibilityType computeCompatibilityType(); @Nonnull static Version inferNextVersion(@Nonnull final Version version, @Nonnull final CompatibilityType compatibilityType); @Nonnull final Version infer(@Nonnull final Version previous); final boolean validate(@Nonnull final Version previous, @Nonnull final Version current); }
Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalArgumentException("Current version <"+previous+"> must be more recent than previous version <"+current+">."); } if (current.isInDevelopment()) { return true; } final Version inferredVersion = infer(previous); return current.toReleaseVersion().compareTo(inferredVersion) >= 0; } Delta(@Nonnull final Set<? extends Difference> differences); @Nonnull final Set<Difference> getDifferences(); @Nonnull final CompatibilityType computeCompatibilityType(); @Nonnull static Version inferNextVersion(@Nonnull final Version version, @Nonnull final CompatibilityType compatibilityType); @Nonnull final Version infer(@Nonnull final Version previous); final boolean validate(@Nonnull final Version previous, @Nonnull final Version current);  }