All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.redis.riot.file.ObjectMapperLineMapper Maven / Gradle / Ivy

The newest version!
package com.redis.riot.file;

import org.springframework.batch.item.file.LineMapper;

import com.fasterxml.jackson.databind.ObjectMapper;

public class ObjectMapperLineMapper implements LineMapper {

	private final Class valueType;
	private final ObjectMapper mapper;

	public ObjectMapperLineMapper(ObjectMapper mapper, Class valueType) {
		this.mapper = mapper;
		this.valueType = valueType;
	}

	@Override
	public T mapLine(String line, int lineNumber) throws Exception {
		return mapper.readValue(line, valueType);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy