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

pack-priv final Class ZonedDateTimeToCalendarConverter

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

Simple converter from Java 8's java.time.ZonedDateTime to java.util.Calendar.

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.GregorianCalendar#toZonedDateTime() as well, and also java.util.Date#from(java.time.Instant) and java.util.Date#toInstant().

Author
Juergen Hoeller
Since
4.0.1
See Also
java.util.GregorianCalendar#from(java.time.ZonedDateTime)

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Calendar
convert(ZonedDateTime
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

ZonedDateTimeToCalendarConverterback to summary
pack-priv ZonedDateTimeToCalendarConverter()

Method Detail

convertback to summary
public Calendar convert(ZonedDateTime 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:ZonedDateTime

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

Returns:Calendar

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

Annotations
@Override