类 Version


  • public final class Version
    extends Object
    Version
    • 字段详细资料

      • DEFAULT_DUBBO_PROTOCOL_VERSION

        public static final String DEFAULT_DUBBO_PROTOCOL_VERSION
        另请参阅:
        常量字段值
      • LEGACY_DUBBO_PROTOCOL_VERSION

        public static final int LEGACY_DUBBO_PROTOCOL_VERSION
        另请参阅:
        常量字段值
      • LOWEST_VERSION_FOR_RESPONSE_ATTACHMENT

        public static final int LOWEST_VERSION_FOR_RESPONSE_ATTACHMENT
        For protocol compatibility purpose. Because isSupportResponseAttachment(java.lang.String) is checked for every call, int compare expect to has higher performance than string.
        另请参阅:
        常量字段值
      • HIGHEST_PROTOCOL_VERSION

        public static final int HIGHEST_PROTOCOL_VERSION
        另请参阅:
        常量字段值
    • 方法详细资料

      • getProtocolVersion

        public static String getProtocolVersion()
      • getVersion

        public static String getVersion()
      • compare

        public static int compare​(String version1,
                                  String version2)
        Compare versions
        返回:
        the value 0 if version1 == version2; a value less than 0 if version1 < version2; and a value greater than 0 if version1 > version2
      • isRelease270OrHigher

        public static boolean isRelease270OrHigher​(String version)
        Check the framework release version number to decide if it's 2.7.0 or higher
      • isRelease263OrHigher

        public static boolean isRelease263OrHigher​(String version)
        Check the framework release version number to decide if it's 2.6.3 or higher
        参数:
        version - , the sdk version
      • isSupportResponseAttachment

        public static boolean isSupportResponseAttachment​(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.
        参数:
        version - , the protocol version.
        返回:
      • getIntVersion

        public static int getIntVersion​(String version)
      • getVersion

        public static String getVersion​(Class<?> cls,
                                        String defaultVersion)
      • checkDuplicate

        public static void checkDuplicate​(Class<?> cls,
                                          boolean failOnError)
      • checkDuplicate

        public static void checkDuplicate​(Class<?> cls)
      • checkDuplicate

        public static void checkDuplicate​(String path,
                                          boolean failOnError)