Share via


ITemporalUnit.IsSupportedBy(ITemporal) Method

Definition

Checks if this unit is supported by the specified temporal object.

[Android.Runtime.Register("isSupportedBy", "(Ljava/time/temporal/Temporal;)Z", "GetIsSupportedBy_Ljava_time_temporal_Temporal_Handler:Java.Time.Temporal.ITemporalUnit, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)]
public virtual bool IsSupportedBy (Java.Time.Temporal.ITemporal? temporal);
[<Android.Runtime.Register("isSupportedBy", "(Ljava/time/temporal/Temporal;)Z", "GetIsSupportedBy_Ljava_time_temporal_Temporal_Handler:Java.Time.Temporal.ITemporalUnit, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)>]
abstract member IsSupportedBy : Java.Time.Temporal.ITemporal -> bool
override this.IsSupportedBy : Java.Time.Temporal.ITemporal -> bool

Parameters

temporal
ITemporal

the temporal object to check, not null

Returns

true if the unit is supported

Attributes

Remarks

Checks if this unit is supported by the specified temporal object.

This checks that the implementing date-time can add/subtract this unit. This can be used to avoid throwing an exception.

This default implementation derives the value using Temporal#plus(long, TemporalUnit).

Java documentation for java.time.temporal.TemporalUnit.isSupportedBy(java.time.temporal.Temporal).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to