Class EngineMappers

java.lang.Object
com.flagsmith.mappers.EngineMappers

public class EngineMappers extends Object
EngineMappers

Utility class for mapping JSON data to flag engine context objects.

  • Constructor Details

    • EngineMappers

      public EngineMappers()
  • Method Details

    • mapFlagResultToFlag

      public static Flag mapFlagResultToFlag(FlagResult flagResult)
      Maps FlagResult to Flag. Returns null if metadata is missing or invalid.
      Parameters:
      flagResult - the flag result
      Returns:
      the mapped flag or null
    • mapContextAndIdentityDataToContext

      public static EvaluationContext mapContextAndIdentityDataToContext(EvaluationContext context, String identifier, Map<String,Object> traits)
      Maps context and identity data to evaluation context.
      Parameters:
      context - the base evaluation context
      identifier - the identity identifier
      traits - optional traits mapping
      Returns:
      the updated evaluation context with identity information
    • mapEnvironmentDocumentToContext

      public static EvaluationContext mapEnvironmentDocumentToContext(com.fasterxml.jackson.databind.JsonNode environmentDocument)
      Maps environment document to evaluation context.
      Parameters:
      environmentDocument - the environment document JSON
      Returns:
      the evaluation context
    • mapEnvironmentToContext

      public static EvaluationContext mapEnvironmentToContext(EnvironmentModel environmentModel)
      Maps environment model to evaluation context.
      Parameters:
      environmentModel - the environment model
      Returns:
      the evaluation context