All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.testcontainers.utility.ComparableVersion Maven / Gradle / Ivy

There is a newer version: 1.20.1
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy