Class FilterAndSortAliasUtil


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

      • 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

        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