Class Resolvers
Inherited Members
Namespace: NodaTime.TimeZones
Assembly: NodaTime.dll
Syntax
public static class Resolvers
Remarks
This class contains predefined implementations of ZoneLocalMappingResolver,
AmbiguousTimeResolver, and SkippedTimeResolver, along with
CreateMappingResolver(AmbiguousTimeResolver, SkippedTimeResolver), which produces a ZoneLocalMappingResolver
from instances of the
other two.
Properties
LenientResolver
Declaration
public static ZoneLocalMappingResolver LenientResolver { get; }
Property Value
Type | Description |
---|---|
ZoneLocalMappingResolver | A ZoneLocalMappingResolver which never throws an exception due to ambiguity or skipped time. |
Remarks
Note: The behavior of this resolver was changed in version 2.0 to fit the most commonly seen real-world usage pattern. Previous versions combined the ReturnLater and ReturnStartOfIntervalAfter resolvers, which can still be used separately if desired.
See Also
ReturnEarlier
Declaration
public static AmbiguousTimeResolver ReturnEarlier { get; }
Property Value
Type | Description |
---|---|
AmbiguousTimeResolver | An AmbiguousTimeResolver which returns the earlier of the two matching times. |
Remarks
This class contains predefined implementations of ZoneLocalMappingResolver,
AmbiguousTimeResolver, and SkippedTimeResolver, along with
CreateMappingResolver(AmbiguousTimeResolver, SkippedTimeResolver), which produces a ZoneLocalMappingResolver
from instances of the
other two.
ReturnEndOfIntervalBefore
Declaration
public static SkippedTimeResolver ReturnEndOfIntervalBefore { get; }
Property Value
Type | Description |
---|---|
SkippedTimeResolver | A SkippedTimeResolver which returns the final tick of the time zone interval before the "gap". |
Remarks
This class contains predefined implementations of ZoneLocalMappingResolver,
AmbiguousTimeResolver, and SkippedTimeResolver, along with
CreateMappingResolver(AmbiguousTimeResolver, SkippedTimeResolver), which produces a ZoneLocalMappingResolver
from instances of the
other two.
ReturnForwardShifted
Declaration
public static SkippedTimeResolver ReturnForwardShifted { get; }
Property Value
Type | Description |
---|---|
SkippedTimeResolver | A SkippedTimeResolver which shifts values in the "gap" forward by the duration of the gap (which is usually 1 hour). |
Remarks
This class contains predefined implementations of ZoneLocalMappingResolver,
AmbiguousTimeResolver, and SkippedTimeResolver, along with
CreateMappingResolver(AmbiguousTimeResolver, SkippedTimeResolver), which produces a ZoneLocalMappingResolver
from instances of the
other two.
ReturnLater
Declaration
public static AmbiguousTimeResolver ReturnLater { get; }
Property Value
Type | Description |
---|---|
AmbiguousTimeResolver | An AmbiguousTimeResolver which returns the later of the two matching times. |
Remarks
This class contains predefined implementations of ZoneLocalMappingResolver,
AmbiguousTimeResolver, and SkippedTimeResolver, along with
CreateMappingResolver(AmbiguousTimeResolver, SkippedTimeResolver), which produces a ZoneLocalMappingResolver
from instances of the
other two.
ReturnStartOfIntervalAfter
Declaration
public static SkippedTimeResolver ReturnStartOfIntervalAfter { get; }
Property Value
Type | Description |
---|---|
SkippedTimeResolver | A SkippedTimeResolver which returns the first tick of the time zone interval after the "gap". |
Remarks
This class contains predefined implementations of ZoneLocalMappingResolver,
AmbiguousTimeResolver, and SkippedTimeResolver, along with
CreateMappingResolver(AmbiguousTimeResolver, SkippedTimeResolver), which produces a ZoneLocalMappingResolver
from instances of the
other two.
StrictResolver
Declaration
public static ZoneLocalMappingResolver StrictResolver { get; }
Property Value
Type | Description |
---|---|
ZoneLocalMappingResolver | A ZoneLocalMappingResolver which only ever succeeds in the (usual) case where the result of the mapping is unambiguous. |
Remarks
See Also
ThrowWhenAmbiguous
Declaration
public static AmbiguousTimeResolver ThrowWhenAmbiguous { get; }
Property Value
Type | Description |
---|---|
AmbiguousTimeResolver | An AmbiguousTimeResolver which simply throws an AmbiguousTimeException. |
Remarks
This class contains predefined implementations of ZoneLocalMappingResolver,
AmbiguousTimeResolver, and SkippedTimeResolver, along with
CreateMappingResolver(AmbiguousTimeResolver, SkippedTimeResolver), which produces a ZoneLocalMappingResolver
from instances of the
other two.
ThrowWhenSkipped
Declaration
public static SkippedTimeResolver ThrowWhenSkipped { get; }
Property Value
Type | Description |
---|---|
SkippedTimeResolver | A SkippedTimeResolver which simply throws a SkippedTimeException. |
Remarks
This class contains predefined implementations of ZoneLocalMappingResolver,
AmbiguousTimeResolver, and SkippedTimeResolver, along with
CreateMappingResolver(AmbiguousTimeResolver, SkippedTimeResolver), which produces a ZoneLocalMappingResolver
from instances of the
other two.
Methods
CreateMappingResolver(AmbiguousTimeResolver, SkippedTimeResolver)
Declaration
public static ZoneLocalMappingResolver CreateMappingResolver(AmbiguousTimeResolver ambiguousTimeResolver, SkippedTimeResolver skippedTimeResolver)
Parameters
Type | Name | Description |
---|---|---|
AmbiguousTimeResolver | ambiguousTimeResolver | Resolver to use for ambiguous mappings. |
SkippedTimeResolver | skippedTimeResolver | Resolver to use for "skipped" mappings. |
Returns
Type | Description |
---|---|
ZoneLocalMappingResolver | The logical combination of the two resolvers. |
Remarks
ZoneLocalMappingResolver
created by this method operates in the obvious way: unambiguous mappings
are returned directly, ambiguous mappings are delegated to the given AmbiguousTimeResolver
, and
"skipped" mappings are delegated to the given SkippedTimeResolver
.