class SchemaUtils {

    public static boolean isAGreatVersion(String schemaVersion, String version) {
        if (StringUtils.isEmpty(schemaVersion) || StringUtils.isEmpty(version)) {
            throw new RuntimeException("schemaVersion or version is empty");
        }

        String[] schemaVersionArr = schemaVersion.split("\\.");
        String[] versionArr = version.split("\\.");
        int arrLength = Math.min(schemaVersionArr.length, versionArr.length);
        for (int i = 0; i < arrLength; i++) {
            if (Integer.parseInt(schemaVersionArr[i]) > Integer.parseInt(versionArr[i])) {
                return true;
            } else if (Integer.parseInt(schemaVersionArr[i]) < Integer.parseInt(versionArr[i])) {
                return false;
            }
        }

        // If the version and schema version is the same from 0 up to the arrlength-1 element,whoever has a larger arrLength has a larger version number
        return schemaVersionArr.length > versionArr.length;
    }

    private  SchemaUtils();

}