Package com.sforce.ws
Class JavaVersion
- java.lang.Object
-
- com.sforce.ws.JavaVersion
-
- All Implemented Interfaces:
Comparable<JavaVersion>
public class JavaVersion extends Object implements Comparable<JavaVersion>
This class represents a semantic java version that can parse a string into different semantic version components (feature, interim, patch, update and build) and can compare two versions based on these components.- Author:
- arjun.mehrotra
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJavaVersion.Builder
-
Field Summary
Fields Modifier and Type Field Description protected static StringINVALID_FEATURE_VALUE_ERRORstatic StringJAVA_VERSION_PROPERTYstatic StringJDK_UPDATE_MESSAGEprotected static StringVERSION_PARSE_ERROR
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(JavaVersion that)intgetBuild()IntegergetFeature()intgetInterim()intgetPatch()intgetUpdate()static booleanjavaVersionHasABug(String runtimeVersion)Check if the provided java version has been patched for the bug JDK-8209178.static JavaVersionparse(String version)StringtoString()
-
-
-
Field Detail
-
VERSION_PARSE_ERROR
protected static final String VERSION_PARSE_ERROR
- See Also:
- Constant Field Values
-
INVALID_FEATURE_VALUE_ERROR
protected static final String INVALID_FEATURE_VALUE_ERROR
- See Also:
- Constant Field Values
-
JAVA_VERSION_PROPERTY
public static final String JAVA_VERSION_PROPERTY
- See Also:
- Constant Field Values
-
JDK_UPDATE_MESSAGE
public static final String JDK_UPDATE_MESSAGE
- See Also:
- Constant Field Values
-
-
Method Detail
-
parse
public static JavaVersion parse(String version)
-
javaVersionHasABug
public static boolean javaVersionHasABug(String runtimeVersion)
Check if the provided java version has been patched for the bug JDK-8209178. Refer JDK-8209178 to get the list of java versions that have fixed the bug.- Parameters:
runtimeVersion- java version- Returns:
- true, if the java version has been patched for the bug, false otherwise
-
compareTo
public int compareTo(JavaVersion that)
- Specified by:
compareToin interfaceComparable<JavaVersion>
-
getFeature
public Integer getFeature()
-
getInterim
public int getInterim()
-
getUpdate
public int getUpdate()
-
getPatch
public int getPatch()
-
getBuild
public int getBuild()
-
-