com.raynigon.unit_api.jackson.UnitApiJacksonConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jackson-starter Show documentation
Show all versions of jackson-starter Show documentation
The jackson-starter is a part of the unit-api
package com.raynigon.unit_api.jackson;
import com.raynigon.unit_api.jackson.config.UnitApiFeature;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
@EnableConfigurationProperties(UnitApiJacksonProperties.class)
class UnitApiJacksonConfiguration {
private final UnitApiJacksonProperties properties;
public UnitApiJacksonConfiguration(UnitApiJacksonProperties properties){
this.properties = properties;
}
@Bean
public UnitApiModule unitApiJacksonModule() {
return UnitApiModule.create()
.enable(properties.getEnabledFeatures().toArray(new UnitApiFeature[0]))
.disable(properties.getDisabledFeatures().toArray(new UnitApiFeature[0]))
.build();
}
}