class JavaTimeTypesParamConverterProvider implements ParamConverterProvider {

    @SuppressWarnings("unchecked")
    @Override
    public <T> ParamConverter<T> getConverter(Class<T> rawType, Type genericType, Annotation[] annotations) {

        if (rawType.equals(LocalDateTime.class)) {
            return (ParamConverter<T>) new LocalDateTimeConverter();
        } else if (rawType.equals(LocalDate.class)) {
            return (ParamConverter<T>) new LocalDateConverter();
        } else if (rawType.equals(LocalTime.class)) {
            return (ParamConverter<T>) new LocalTimeConverter();
        } else if (rawType.equals(OffsetDateTime.class)) {
            return (ParamConverter<T>) new OffsetDateTimeConverter();
        } else if (rawType.equals(OffsetTime.class)) {
            return (ParamConverter<T>) new OffsetTimeConverter();
        } else if (rawType.equals(ZonedDateTime.class)) {
            return (ParamConverter<T>) new ZonedDateTimeConverter();
        } else {
            return null;
        }
    }

}