
com.mageddo.featureswitch.EnumFeatureMetadataProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of feature-switch Show documentation
Show all versions of feature-switch Show documentation
Simplify Consumer And Producer Configuration
The newest version!
package com.mageddo.featureswitch;
import java.util.HashMap;
import java.util.Map;
public class EnumFeatureMetadataProvider implements FeatureMetadataProvider {
@Override
public FeatureMetadata getMetadata(Feature feature) {
final FeatureDefaults an = AnnotationUtils.getAnnotation(feature, FeatureDefaults.class);
final Map m = new HashMap<>();
if(an == null){
m.put(FeatureKeys.STATUS, String.valueOf(Status.INACTIVE.getCode()));
m.put(FeatureKeys.VALUE, "");
} else {
m.put(FeatureKeys.STATUS, String.valueOf(an.status().getCode()));
m.put(FeatureKeys.VALUE, an.value());
}
return new DefaultFeatureMetadata(feature, m);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy