objectMapper(Jackson2ObjectMapperBuilder)   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 6
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 5
c 1
b 1
f 0
dl 0
loc 6
rs 10
cc 1
1
package com.hltech.judged.server.config;
2
3
import com.fasterxml.jackson.databind.ObjectMapper;
4
import com.fasterxml.jackson.databind.SerializationFeature;
5
import org.springframework.context.annotation.Bean;
6
import org.springframework.context.annotation.Configuration;
7
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
8
9
@Configuration
10
public class BeanFactory {
11
12
    @Bean
13
    ObjectMapper objectMapper(Jackson2ObjectMapperBuilder mapperBuilder) {
14
        ObjectMapper objectMapper = mapperBuilder.build();
15
16
        objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
17
        return objectMapper;
18
    }
19
}
20