com.raynigon.unit_api.jackson.UnitApiJacksonProperties 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.ConfigurationProperties;
import java.util.EnumMap;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
@ConfigurationProperties(prefix="spring.jackson.unit-api")
public class UnitApiJacksonProperties {
private Map features = new EnumMap<>(UnitApiFeature.class);
public void setFeatures(Map features) {
this.features = features;
}
public Map getFeatures() {
return features;
}
public Set getEnabledFeatures(){
return features.entrySet().stream()
.filter(Map.Entry::getValue)
.map(Map.Entry::getKey)
.collect(Collectors.toSet());
}
public Set getDisabledFeatures(){
return features.entrySet().stream()
.filter(it->!it.getValue())
.map(Map.Entry::getKey)
.collect(Collectors.toSet());
}
}