com.hltech.judged.server.config.BeanFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 1
eloc 6
c 1
b 1
f 0
dl 0
loc 9
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A objectMapper(Jackson2ObjectMapperBuilder) 0 6 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