Class CronMacro
java.lang.Object
cloud.opencode.base.cron.CronMacro
Cron Macro - Predefined Cron Expression Shortcuts
Cron宏 - 预定义的Cron表达式快捷方式
Resolves standard cron macros to their equivalent 5-field expressions.
Macros are case-insensitive and start with @.
将标准Cron宏解析为等效的5字段表达式。
宏不区分大小写,以 @ 开头。
Features | 主要功能:
@yearly/@annually—0 0 1 1 *(January 1st at midnight - 每年1月1日午夜)@monthly—0 0 1 * *(1st of each month - 每月1号午夜)@weekly—0 0 * * 0(Sunday at midnight - 每周日午夜)@daily/@midnight—0 0 * * *(every day at midnight - 每天午夜)@hourly—0 * * * *(every hour - 每小时)
Usage Examples | 使用示例:
CronMacro.resolve("@daily") // "0 0 * * *"
CronMacro.resolve("@yearly") // "0 0 1 1 *"
CronMacro.isMacro("@hourly") // true
CronMacro.isMacro("0 * * * *") // false
Security | 安全性:
- Thread-safe: Yes (stateless static methods, immutable map) - 线程安全: 是
- Null-safe: Yes - 空值安全: 是
- Since:
- JDK 25, opencode-base-cron V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Method Summary
-
Method Details
-
resolve
-
isMacro
Checks if the input is a known macro 检查输入是否是已知宏- Parameters:
input- the input string | 输入字符串- Returns:
- true if it is a macro | 如果是宏返回true
-