com.jslsolucoes.spring.converter.LocalDateConverter Maven / Gradle / Ivy
package com.jslsolucoes.spring.converter;
import java.time.LocalDate;
import java.time.LocalDateTime;
import org.springframework.core.convert.converter.Converter;
public class LocalDateConverter implements Converter {
private LocalDateTimeConverter localDateTimeConverter;
public LocalDateConverter(LocalDateTimeConverter localDateTimeConverter) {
this.localDateTimeConverter = localDateTimeConverter;
}
@Override
public LocalDate convert(String value) {
LocalDateTime localDateTime = localDateTimeConverter.convert(value);
if (localDateTime != null) {
return localDateTime.toLocalDate();
}
return null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy