docs: 补全 src 全部 Kotlin KDoc 与 Java Javadoc,版本升级至 5.5.1
Gitea Actions Build / Build (push) Canceled after 0s
Gitea Actions Build / Build (push) Canceled after 0s
为所有缺失文档的公开声明补充中文 KDoc/Javadoc(含 exception、json、 springboot、tuple 生成类、MediaType 枚举项及测试),仅插入注释不改代码; gradle.properties VERSIONS 5.4.4 -> 5.5.1。
This commit is contained in:
@@ -30,6 +30,11 @@ import java.nio.file.*
|
||||
import java.util.*
|
||||
import java.util.function.Consumer
|
||||
|
||||
/**
|
||||
* 操作系统路径封装类,通过委托实现 Path 接口,并提供多种来源的静态工厂方法。
|
||||
*
|
||||
* @param path 被委托的底层 Path 实例
|
||||
*/
|
||||
class OsPath private constructor(private val path: Path) : Path by path {
|
||||
override fun forEach(action: Consumer<in Path>?) {
|
||||
path.forEach(action)
|
||||
@@ -74,27 +79,59 @@ class OsPath private constructor(private val path: Path) : Path by path {
|
||||
return path.iterator()
|
||||
}
|
||||
|
||||
/**
|
||||
* 伴生对象,提供从字符串、Path、URI、File 等创建 OsPath 实例的静态工厂方法。
|
||||
*/
|
||||
companion object {
|
||||
/**
|
||||
* 根据路径字符串创建 OsPath 实例。
|
||||
*
|
||||
* @param path 路径字符串
|
||||
* @return 对应的 OsPath 实例
|
||||
*/
|
||||
@JvmStatic
|
||||
fun of(path: String): OsPath {
|
||||
return of(Paths.get(path))
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据 Path 对象创建 OsPath 实例。
|
||||
*
|
||||
* @param path Path 对象
|
||||
* @return 对应的 OsPath 实例
|
||||
*/
|
||||
@JvmStatic
|
||||
fun of(path: Path): OsPath {
|
||||
return OsPath(path)
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据 URI 创建 OsPath 实例。
|
||||
*
|
||||
* @param uri 文件 URI
|
||||
* @return 对应的 OsPath 实例
|
||||
*/
|
||||
@JvmStatic
|
||||
fun of(uri: URI): OsPath {
|
||||
return OsPath(Paths.get(uri))
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据 File 对象创建 OsPath 实例。
|
||||
*
|
||||
* @param file File 对象
|
||||
* @return 对应的 OsPath 实例
|
||||
*/
|
||||
@JvmStatic
|
||||
fun of(file: File): OsPath {
|
||||
return OsPath(file.toPath())
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取表示当前工作目录的 OsPath 实例。
|
||||
*
|
||||
* @return 当前工作目录对应的 OsPath 实例
|
||||
*/
|
||||
@JvmStatic
|
||||
fun getCwd(): OsPath {
|
||||
return OsPath(Paths.get(""))
|
||||
|
||||
Reference in New Issue
Block a user