Aracılığıyla paylaş


IChronoLocalDateTime.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.Chrono.IChronoLocalDateTime, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)]
override sealed bool ITemporal.IsSupported (Java.Time.Temporal.ITemporalUnit? unit);
[<Android.Runtime.Register("isSupported", "(Ljava/time/temporal/TemporalUnit;)Z", "GetIsSupported_Ljava_time_temporal_TemporalUnit_Handler:Java.Time.Chrono.IChronoLocalDateTime, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)>]
abstract member Java.Time.Temporal.ITemporal.IsSupported : Java.Time.Temporal.ITemporalUnit -> bool
override this.Java.Time.Temporal.ITemporal.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

Implements

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.

The set of supported units is defined by the chronology and normally includes all ChronoUnit units except FOREVER.

If the unit is not a ChronoUnit, then the result of this method is obtained by invoking TemporalUnit.isSupportedBy(Temporal) passing this as the argument. Whether the unit is supported is determined by the unit.

Java documentation for java.time.chrono.ChronoLocalDateTime.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