ITemporalAdjuster.AdjustInto(ITemporal) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
调整指定的时态对象。
[Android.Runtime.Register("adjustInto", "(Ljava/time/temporal/Temporal;)Ljava/time/temporal/Temporal;", "GetAdjustInto_Ljava_time_temporal_Temporal_Handler:Java.Time.Temporal.ITemporalAdjusterInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)]
public Java.Time.Temporal.ITemporal? AdjustInto(Java.Time.Temporal.ITemporal? temporal);
[<Android.Runtime.Register("adjustInto", "(Ljava/time/temporal/Temporal;)Ljava/time/temporal/Temporal;", "GetAdjustInto_Ljava_time_temporal_Temporal_Handler:Java.Time.Temporal.ITemporalAdjusterInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)>]
abstract member AdjustInto : Java.Time.Temporal.ITemporal -> Java.Time.Temporal.ITemporal
参数
- temporal
- ITemporal
要调整的临时对象,而不是 null
返回
具有调整的相同可观察类型的对象,而不是 null
- 特性
注解
调整指定的时态对象。
这将使用封装在实现类中的逻辑调整指定的临时对象。 例如,设置避免周末的日期的调整器,或者将日期设置为月份的最后一天。
使用此方法有两种等效的方法。 第一种方法是直接调用此方法。 第二种是使用 Temporal#with(TemporalAdjuster):
// these two lines are equivalent, but the second approach is recommended
temporal = thisAdjuster.adjustInto(temporal);
temporal = temporal.with(thisAdjuster);
建议使用第二种方法, with(TemporalAdjuster)因为在代码中读取内容要清晰得多。
Java文档java.time.temporal.TemporalAdjuster.adjustInto(java.time.temporal.Temporal)。
本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。