Class CachedDTOAwareFieldResolver
java.lang.Object
in.co.akshitbansal.springwebquery.resolver.field.DTOAwareFieldResolver
in.co.akshitbansal.springwebquery.resolver.field.cache.CachedDTOAwareFieldResolver
- All Implemented Interfaces:
FieldResolver
DTOAwareFieldResolver variant that caches DTO-path resolution
outcomes.
Successful resolutions are memoized by CacheKey, and a per-key
lock is used to avoid duplicate reflective resolution work when multiple
threads request the same path concurrently.
-
Field Summary
Fields inherited from class in.co.akshitbansal.springwebquery.resolver.field.DTOAwareFieldResolver
dtoClass, entityClass -
Constructor Summary
ConstructorsConstructorDescriptionCachedDTOAwareFieldResolver(@NonNull Class<?> entityClass, @NonNull Class<?> dtoClass, @NonNull DTOAwareFieldResolutionCache cache) Creates a cached DTO-aware field resolver for a single query contract. -
Method Summary
Modifier and TypeMethodDescriptionresolvePath(@NonNull String dtoPath) Resolves the supplied DTO selector path, consulting and populating the shared cache around the superclass's reflective resolution logic.
-
Constructor Details
-
CachedDTOAwareFieldResolver
public CachedDTOAwareFieldResolver(@NonNull @NonNull Class<?> entityClass, @NonNull @NonNull Class<?> dtoClass, @NonNull @NonNull DTOAwareFieldResolutionCache cache) Creates a cached DTO-aware field resolver for a single query contract.- Parameters:
entityClass- entity type used to validate mapped pathsdtoClass- DTO type exposed to API callerscache- shared cache for resolution results
-
-
Method Details
-
resolvePath
Resolves the supplied DTO selector path, consulting and populating the shared cache around the superclass's reflective resolution logic.- Specified by:
resolvePathin interfaceFieldResolver- Overrides:
resolvePathin classDTOAwareFieldResolver- Parameters:
dtoPath- selector path from the incoming request- Returns:
- resolution result containing the mapped entity path and terminal DTO field
-