Language

ChronoField.IsSupportedBy(ITemporalAccessor) Method

Definition

Checks if this field is supported by the temporal object.

[Android.Runtime.Register("isSupportedBy", "(Ljava/time/temporal/TemporalAccessor;)Z", "", ApiSince=26)]
public bool IsSupportedBy(Java.Time.Temporal.ITemporalAccessor? temporal);
[<Android.Runtime.Register("isSupportedBy", "(Ljava/time/temporal/TemporalAccessor;)Z", "", ApiSince=26)>]
abstract member IsSupportedBy : Java.Time.Temporal.ITemporalAccessor -> bool
override this.IsSupportedBy : Java.Time.Temporal.ITemporalAccessor -> bool

Parameters

temporal
ITemporalAccessor

the temporal object to query, not null

Returns

true if the date-time can be queried for this field, false if not

Implements

Attributes

Remarks

Checks if this field is supported by the temporal object. This determines whether the temporal accessor supports this field. If this returns false, then the temporal cannot be queried for this field. There are two equivalent ways of using this method. The first is to invoke this method directly.

// these two lines are equivalent, but the second approach is recommended
temporal = thisField.isSupportedBy(temporal);
temporal = temporal.isSupported(thisField);

It is recommended to use the second approach, isSupported(TemporalField), as it is a lot clearer to read in code. Implementations should determine whether they are supported using the fields available in ChronoField.

Java reference for java.time.temporal.ChronoField.isSupportedBy.

Applies to