Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: TemporalArgumentParser #1748

Merged
merged 9 commits into from
Jan 14, 2022
Merged

Conversation

cssxsh
Copy link
Contributor

@cssxsh cssxsh commented Dec 18, 2021

添加 TemporalArgumentParser 类似 EnumValueArgumentParser
自动完成 LocalDate OffsetDateTimejava.time.temporal.Temporal 实现类 的 解析

Copy link
Member

@Him188 Him188 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我不推荐用反射实现

@Him188
Copy link
Member

Him188 commented Dec 18, 2021

For mamoe, after merge:

Mark @MiraiExperimentalApi, add @since, maybe update docs

@Him188 Him188 added s:console 子系统: mirai-console t:feature 类型: 新特性 N 优先级: 一般 labels Dec 18, 2021
@Him188 Him188 added this to the 2.10.0-RC milestone Dec 18, 2021
@Him188 Him188 added the z:ready-to-merge 状态: PR 已经可以合并, 正在等待一些安排 label Dec 21, 2021
Copy link
Member

@Karlatemp Karlatemp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add some tests

@Him188 Him188 removed the z:ready-to-merge 状态: PR 已经可以合并, 正在等待一些安排 label Dec 22, 2021
@Karlatemp Karlatemp added the z:ready-to-merge 状态: PR 已经可以合并, 正在等待一些安排 label Dec 27, 2021
Comment on lines 483 to 488
/**
* 解析参数为时间 [T]
* @param now 返回当前时间
* @param parse 从字符串解析时间
*/
public class TemporalArgumentParser<T : TemporalAccessor>(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

由于设置不允许 maintainer 修改, 请标注 @MiraiExperimentalApi, 注释 @since 2.10, 准备合并

@Him188 Him188 removed the z:ready-to-merge 状态: PR 已经可以合并, 正在等待一些安排 label Jan 10, 2022
@cssxsh cssxsh requested a review from Him188 January 10, 2022 23:55
@Him188
Copy link
Member

Him188 commented Jan 11, 2022

conflicts?

@cssxsh cssxsh requested a review from Him188 January 11, 2022 01:31
@Him188 Him188 added the z:ready-to-merge 状态: PR 已经可以合并, 正在等待一些安排 label Jan 12, 2022
@Him188 Him188 merged commit a3d29b8 into mamoe:dev Jan 14, 2022
strear pushed a commit to strear/mirai that referenced this pull request Feb 21, 2022
* add: TemporalArgumentParser

* fix: no reflect

* fix: delete @Suppress("UNCHECKED_CAST")

* fix: Temporal -> TemporalAccessor

* add: test temporal argument

* add: isInstance

* docs: since 2.10

* docs: since 2.10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
N 优先级: 一般 s:console 子系统: mirai-console t:feature 类型: 新特性 z:ready-to-merge 状态: PR 已经可以合并, 正在等待一些安排
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants