Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright (c) 2024. looly([email protected])
* Hutool is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
* https://license.coscl.org.cn/MulanPSL2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
*/
package cn.hutool.core.lang;
import cn.hutool.core.comparator.CompareUtil;
import cn.hutool.core.util.CharUtil;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* 字符串版本表示,用于解析版本号的不同部分并比较大小。
* 来自:java.lang.module.ModuleDescriptor.Version
*
* @author Looly
*/
public class Version implements Comparable, Serializable {
private static final long serialVersionUID = 1L;
/**
* 解析版本字符串为Version对象
*
* @param v 版本字符串
* @return The resulting {@code Version}
* @throws IllegalArgumentException 如果 {@code v} 为 {@code null}或 ""或无法解析的字符串,抛出此异常
*/
public static Version of(final String v) {
return new Version(v);
}
private final String version;
private final List