Top Description Constructors Methods
org.springframework.core.convert.support

pack-priv final Class ZoneIdToTimeZoneConverter

extends Object
implements Converter<ZoneId, TimeZone>
Class Inheritance
All Implemented Interfaces
org.springframework.core.convert.converter.Converter
Imports
java.time.ZoneId, java.util.TimeZone, org.springframework.core.convert.converter.Converter

Simple converter from Java 8's java.time.ZoneId to java.util.TimeZone.

Note that Spring's default ConversionService setup understands the 'from'/'to' convention that the JSR-310 java.time package consistently uses. That convention is implemented reflectively in ObjectToObjectConverter, not in specific JSR-310 converters. It covers java.util.TimeZone#toZoneId() as well, and also java.util.Date#from(java.time.Instant) and java.util.Date#toInstant().

Author
Juergen Hoeller
Since
4.0
See Also
TimeZone#getTimeZone(java.time.ZoneId)

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public TimeZone
convert(ZoneId
the source object to convert, which must be an instance of S (never null)
source
)

Implements org.springframework.core.convert.converter.Converter.convert.

Convert the source object of type S to target type T.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ZoneIdToTimeZoneConverterback to summary
pack-priv ZoneIdToTimeZoneConverter()

Method Detail

convertback to summary
public TimeZone convert(ZoneId source)

Implements org.springframework.core.convert.converter.Converter.convert.

Doc from org.springframework.core.convert.converter.Converter.convert.

Convert the source object of type S to target type T.

Parameters
source:ZoneId

the source object to convert, which must be an instance of S (never null)

Returns:TimeZone

the converted object, which must be an instance of T (potentially null)

Annotations
@Override