Mapper Read CRUDRepo
A ReadCRUDRepo wrapper that maps between different key and value types. Allows adapting a repository with one type system to work with another type system.
Parameters
The underlying repository to wrap
The mapper that defines the bidirectional type conversions
Type Parameters
The external ID type exposed by this wrapper
The external object type exposed by this wrapper
The internal ID type used by the underlying repository
The internal object type used by the underlying repository
Constructors
Properties
Functions
Wraps this ReadCRUDRepo as a ReadKeyValueFromCRUDRepo, exposing CRUD IDs as keys and CRUD objects as values in a ReadKeyValueRepo.
Computes the difference between this ReadCRUDRepo and a map of items. Retrieves all items from the repository and compares them with the provided map.
Returns all objects in the repository as a map of ID to object. Default implementation iterates all pages using getIdsByPagination and getById.
Returns the object associated with the given id, or null if not found.
Returns a paginated list of all objects in the repository.
Returns a paginated list of all IDs in the repository.
Creates a pagination starting from the first page with size equal to the total count of items in this ReadCRUDRepo. This effectively creates a single page containing all items.
Converts a key from the outer type to the inner type.
Converts a value from the outer type to the inner type.
Converts a value from the inner type to the outer type.
Wraps this ReadCRUDRepo with a mapper to expose different key and value types.
Wraps this ReadCRUDRepo with custom conversion functions for keys and values.