ITemporal.IsSupported(ITemporalUnit) Method

Definition

Checks if the specified unit is supported.

[Android.Runtime.Register("isSupported", "(Ljava/time/temporal/TemporalUnit;)Z", "GetIsSupported_Ljava_time_temporal_TemporalUnit_Handler:Java.Time.Temporal.ITemporalInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)]
public bool IsSupported (Java.Time.Temporal.ITemporalUnit? unit);
[<Android.Runtime.Register("isSupported", "(Ljava/time/temporal/TemporalUnit;)Z", "GetIsSupported_Ljava_time_temporal_TemporalUnit_Handler:Java.Time.Temporal.ITemporalInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)>]
abstract member IsSupported : Java.Time.Temporal.ITemporalUnit -> bool

Parameters

unit
ITemporalUnit

the unit to check, null returns false

Returns

true if the unit can be added/subtracted, false if not

Attributes

Remarks

Checks if the specified unit is supported.

This checks if the specified unit can be added to, or subtracted from, this date-time. If false, then calling the #plus(long, TemporalUnit) and #minus(long, TemporalUnit) minus methods will throw an exception.

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

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