Class FilterAndSortAliasUtil

java.lang.Object
com.broadleafcommerce.data.tracking.core.mapping.FilterAndSortAliasUtil

public final class FilterAndSortAliasUtil extends Object
Utilities for processing FilterAndSortAlias
Author:
Phillip Verheyden (phillipuniverse)
  • Method Details

    • transformField

      @Nullable public static String transformField(@Nullable String aliasedPath, Class<?> clazz)

      Transforms a given field to its real domain class representation based on FilterAndSortAlias annotations. This supports nested properties and can resolve aliases down through a class relationship tree.

      This makes a best effort to transform the given fields, but will simply stop at transformation if there are fields within <alias

      Parameters:
      aliasedPath - a field from the class that could be annotated, can be null
      clazz - the class to map fields onto, that could be annotated with FilterAndSortAlias
      Returns:
      the transformed path corresponding to real field names on clazz. If fields are unaliased or do not appear on clazz, then no transformation is made. This only returns null if aliasedPath was null