Package org.apache.dubbo.common
Class Version
java.lang.Object
org.apache.dubbo.common.Version
Version
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final intstatic final intstatic final intFor protocol compatibility purpose. -
Method Summary
Modifier and TypeMethodDescriptionstatic intCompare versionsstatic intgetIntVersion(String version) static Stringstatic Stringstatic Stringstatic StringgetVersion(Class<?> cls, String defaultVersion) static booleanisRelease263OrHigher(String version) Check the framework release version number to decide if it's 2.6.3 or higherstatic booleanisRelease270OrHigher(String version) Check the framework release version number to decide if it's 2.7.0 or higherstatic booleanisSupportResponseAttachment(String version) Dubbo 2.x protocol version numbers are limited to 2.0.2/2000200 ~ 2.0.99/2009900, other versions are consider as invalid or not from official release.
-
Field Details
-
DEFAULT_DUBBO_PROTOCOL_VERSION
- See Also:
-
LEGACY_DUBBO_PROTOCOL_VERSION
public static final int LEGACY_DUBBO_PROTOCOL_VERSION- See Also:
-
LOWEST_VERSION_FOR_RESPONSE_ATTACHMENT
public static final int LOWEST_VERSION_FOR_RESPONSE_ATTACHMENTFor protocol compatibility purpose. BecauseisSupportResponseAttachment(java.lang.String)is checked for every call, int compare expect to has higher performance than string.- See Also:
-
HIGHEST_PROTOCOL_VERSION
public static final int HIGHEST_PROTOCOL_VERSION- See Also:
-
-
Method Details
-
getProtocolVersion
-
getVersion
-
getLastCommitId
-
compare
Compare versions- Returns:
- the value
0ifversion1 == version2; a value less than0ifversion1 < version2; and a value greater than0ifversion1 > version2
-
isRelease270OrHigher
Check the framework release version number to decide if it's 2.7.0 or higher -
isRelease263OrHigher
Check the framework release version number to decide if it's 2.6.3 or higher- Parameters:
version- , the sdk version
-
isSupportResponseAttachment
Dubbo 2.x protocol version numbers are limited to 2.0.2/2000200 ~ 2.0.99/2009900, other versions are consider as invalid or not from official release.- Parameters:
version- , the protocol version.- Returns:
-
getIntVersion
-
getVersion
-