public class Version extends Object implements Comparable<Version>, Serializable
Constructor and Description |
---|
Version(String v)
版本对象,格式:tok+ ( '-' tok+)? ( '+' tok+)?,版本之间使用'.'或'-'分隔,版本号可能包含'+'
数字部分按照大小比较,字符串按照字典顺序比较。 sequence: 主版本号 pre: 次版本号 build: 构建版本 |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Version that) |
boolean |
equals(Object ob) |
int |
hashCode() |
static Version |
of(String v)
解析版本字符串为Version对象
|
String |
toString() |
public Version(String v)
v
- 版本字符串public static Version of(String v)
v
- 版本字符串Version
IllegalArgumentException
- 如果 v
为 null
或 ""或无法解析的字符串,抛出此异常public int compareTo(Version that)
compareTo
in interface Comparable<Version>
Copyright © 2024. All rights reserved.