Class DynOCriteriaMapperConverter

java.lang.Object
overit.geocall.model.converters.DynOCriteriaMapperConverter

@Service public class DynOCriteriaMapperConverter extends Object
ModelMapper converter for transforming dynamic object criteria maps.

This converter processes maps containing criteria keys and values, converting field names to their corresponding static attribute names while preserving extension attributes and suffix notation (key:suffix format).

  • Constructor Details

    • DynOCriteriaMapperConverter

      public DynOCriteriaMapperConverter(FindStaticAttribute findStaticAttribute)
  • Method Details

    • convert

      public Map<String,?> convert(Map<String,?> sourceMap, TypeMap<?,?> typeMap)
      Converts a source map by transforming field names to their corresponding static attribute names.

      This method processes the source map in two phases:

      1. Converts regular field names (excluding extension attributes) to their static attribute equivalents
      2. Preserves all extension attributes (keys starting with "extension.") without modification

      The method supports suffix notation where keys can contain a colon-separated suffix (e.g., "fieldName:suffix"). When a suffix is present, it is preserved in the converted key after the static attribute name is resolved.

      Parameters:
      sourceMap - the source map containing criteria keys and values to be converted
      typeMap - the ModelMapper TypeMap used to resolve field name mappings
      Returns:
      a new map with converted field names, preserving extension attributes and suffix notation