Slide 17
Slide 17 text
17
public class FormatStringAsDocument extends
SimpleFunction {
@Override
public Document apply(String input) {
ObjectMapper objectMapper = new ObjectMapper();
Timestamp timestamp =
objectMapper.readValue(input, Timestamp.class);
Map value =
objectMapper.convertValue(timestamp, new
TypeReference>() {
});
Document document = new Document(value);
return document;
}
}