dev.openfeature.contrib.providers.flipt.ContextTransformer Maven / Gradle / Ivy
The newest version!
package dev.openfeature.contrib.providers.flipt;
import dev.openfeature.sdk.EvaluationContext;
import java.util.HashMap;
import java.util.Map;
/**
* Transformer from OpenFeature context to Flipt context.
*/
public class ContextTransformer {
protected static Map transform(EvaluationContext ctx) {
Map contextMap = new HashMap<>();
ctx.asObjectMap().forEach((k, v) -> {
contextMap.put(k, String.valueOf(v));
});
return contextMap;
}
}