Class HotRodVersionUtils
- java.lang.Object
-
- org.keycloak.models.map.storage.hotRod.common.HotRodVersionUtils
-
public class HotRodVersionUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description HotRodVersionUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanadjacentVersions(Integer version1, Integer version2)Decides whetherversion1andversion2are adjacent values (there are no versions between these)static booleanisVersion2NewerThanVersion1(Integer version1, Integer version2)Decides whetherversion1is older thanversion2static IntegerparseSchemaVersionFromProtoFile(String protoFile)Searches givenprotoFilestring for occurrences of string schema-version: X, where X is version of current schema in theprotoFilestring
-
-
-
Method Detail
-
isVersion2NewerThanVersion1
public static boolean isVersion2NewerThanVersion1(Integer version1, Integer version2)
Decides whetherversion1is older thanversion2- Parameters:
version1- first versionversion2- second version- Returns:
- returns true when
version1is older thanversion2and false when versions are equal orversion2is older thanversion1
-
adjacentVersions
public static boolean adjacentVersions(Integer version1, Integer version2)
Decides whetherversion1andversion2are adjacent values (there are no versions between these)- Parameters:
version1- first versionversion2- second version- Returns:
- returns true when
version1andversion2are adjacent, false otherwise
-
parseSchemaVersionFromProtoFile
public static Integer parseSchemaVersionFromProtoFile(String protoFile)
Searches givenprotoFilestring for occurrences of string schema-version: X, where X is version of current schema in theprotoFilestring- Parameters:
protoFile- schema to search- Returns:
- Integer object representing version of schema within
protoFileornullif not found - Throws:
IllegalStateException- if file contains more than one version definitions
-
-