org.testcontainers.utility.ComparableVersion Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of testcontainers Show documentation
Show all versions of testcontainers Show documentation
Isolated container management for Java code testing
package org.testcontainers.utility;
import org.jetbrains.annotations.NotNull;
public class ComparableVersion implements Comparable {
private final String[] parts;
public ComparableVersion(String version) {
this.parts = version.split("\\.");
}
@Override
public int compareTo(@NotNull ComparableVersion other) {
for (int i=0; i otherPart) {
return 1;
} else if (thisPart < otherPart) {
return -1;
}
}
return 0;
}
}