語言

ITemporalAdjuster.AdjustInto(ITemporal) 方法

定義

調整指定的時間物件。

[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

調整的時間對象,而非空

傳回

具有相同可觀察型態且已調整的物件,而非空

屬性

備註

調整指定的時間物件。

此方法會根據實作類別封裝的邏輯調整指定的時序物件。 例如,理賠員會設定日期,避免週末,或是將日期設定在月底的最後一天。

使用此方法有兩種等效方式。 第一種是直接引用此方法。 第二種是使用 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.time.temporal.TemporalAdjuster.adjustInto(java.time.temporal.Temporal)Java 檔。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於