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 boolean
adjacentVersions(Integer version1, Integer version2)
Decides whetherversion1
andversion2
are adjacent values (there are no versions between these)static boolean
isVersion2NewerThanVersion1(Integer version1, Integer version2)
Decides whetherversion1
is older thanversion2
static Integer
parseSchemaVersionFromProtoFile(String protoFile)
Searches givenprotoFile
string for occurrences of string schema-version: X, where X is version of current schema in theprotoFile
string
-
-
-
Method Detail
-
isVersion2NewerThanVersion1
public static boolean isVersion2NewerThanVersion1(Integer version1, Integer version2)
Decides whetherversion1
is older thanversion2
- Parameters:
version1
- first versionversion2
- second version- Returns:
- returns true when
version1
is older thanversion2
and false when versions are equal orversion2
is older thanversion1
-
adjacentVersions
public static boolean adjacentVersions(Integer version1, Integer version2)
Decides whetherversion1
andversion2
are adjacent values (there are no versions between these)- Parameters:
version1
- first versionversion2
- second version- Returns:
- returns true when
version1
andversion2
are adjacent, false otherwise
-
parseSchemaVersionFromProtoFile
public static Integer parseSchemaVersionFromProtoFile(String protoFile)
Searches givenprotoFile
string for occurrences of string schema-version: X, where X is version of current schema in theprotoFile
string- Parameters:
protoFile
- schema to search- Returns:
- Integer object representing version of schema within
protoFile
ornull
if not found - Throws:
IllegalStateException
- if file contains more than one version definitions
-
-