Class HotRodVersionUtils


  • public class HotRodVersionUtils
    extends Object
    • Constructor Detail

      • HotRodVersionUtils

        public HotRodVersionUtils()
    • Method Detail

      • isVersion2NewerThanVersion1

        public static boolean isVersion2NewerThanVersion1​(Integer version1,
                                                          Integer version2)
        Decides whether version1 is older than version2
        Parameters:
        version1 - first version
        version2 - second version
        Returns:
        returns true when version1 is older than version2 and false when versions are equal or version2 is older than version1
      • adjacentVersions

        public static boolean adjacentVersions​(Integer version1,
                                               Integer version2)
        Decides whether version1 and version2 are adjacent values (there are no versions between these)
        Parameters:
        version1 - first version
        version2 - second version
        Returns:
        returns true when version1 and version2 are adjacent, false otherwise
      • parseSchemaVersionFromProtoFile

        public static Integer parseSchemaVersionFromProtoFile​(String protoFile)
        Searches given protoFile string for occurrences of string schema-version: X, where X is version of current schema in the protoFile string
        Parameters:
        protoFile - schema to search
        Returns:
        Integer object representing version of schema within protoFile or null if not found
        Throws:
        IllegalStateException - if file contains more than one version definitions