Class FromTimeStringToDateConverter
java.lang.Object
overit.geocallapp.utilities.rs.converter.FromTimeStringToDateConverter
public class FromTimeStringToDateConverter
extends Object
implements ConditionalConverter<String,Date>
A
This converter parses ISO local time format strings and converts them to
The converter is designed to be registered with
ConditionalConverter implementation that transforms time string representations into Date objects.This converter parses ISO local time format strings and converts them to
Date objects using the system default timezone.The converter is designed to be registered with
M2Mapper for automatic string-to-date conversions during object mapping.- Since:
- 1.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.modelmapper.spi.ConditionalConverter
ConditionalConverter.MatchResult -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvert(MappingContext<String, Date> context) Determines if this converter can handle the conversion between the specified source and destination types.
-
Constructor Details
-
FromTimeStringToDateConverter
public FromTimeStringToDateConverter()Creates a new instance of the converter.
-
-
Method Details
-
match
Determines if this converter can handle the conversion between the specified source and destination types. Returns FULL match if source type is assignable fromStringand destination type is assignable fromDate.- Specified by:
matchin interfaceConditionalConverter<String,Date> - Parameters:
sourceType- the source class type to evaluate for conversion compatibilitydestinationType- the destination class type to evaluate for conversion compatibility- Returns:
ConditionalConverter.MatchResult.FULLif conversion is supported,ConditionalConverter.MatchResult.NONEotherwise
-
convert
Performs the actual conversion from timeStringtoDate. Parses the source string using ISO local time format and converts it to a Date usingLocalDate.EPOCHas the date component. If the source string is null, returns the existing destination value.
-