java.lang.Object
org.litebridge.orm.persistence.DtoCacheImpl
- All Implemented Interfaces:
DtoCache
A concrete implementation of the
DtoCache interface that uses a Map-based caching mechanism.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<DTO> @Nullable DTORetrieves a cached Data Transfer Object (DTO) of the specified class type and identifier.<DTO> @Nullable List<DTO> Retrieves a list of all cached Data Transfer Objects (DTOs) of the specified class type.voidStores a Data Transfer Object (DTO) in the cache associated with the provided identifier.
-
Constructor Details
-
DtoCacheImpl
public DtoCacheImpl()
-
-
Method Details
-
get
Description copied from interface:DtoCacheRetrieves a cached Data Transfer Object (DTO) of the specified class type and identifier. If no matching DTO is found in the cache, this method returnsnull.- Specified by:
getin interfaceDtoCache- Type Parameters:
DTO- The type of the Data Transfer Object.- Parameters:
dtoClass- The class type of the DTO to retrieve.id- The identifier used to locate the DTO in the cache. This is typically a list of keys representing a unique identifier for the DTO.- Returns:
- The cached instance of the specified DTO type matching the given identifier,
or
nullif no such DTO is found.
-
put
Description copied from interface:DtoCacheStores a Data Transfer Object (DTO) in the cache associated with the provided identifier. The identifier is typically a list of keys that uniquely represents the DTO. If the provided DTO isnull, this method may effectively remove any existing entry associated with the given identifier, depending on the implementation.- Specified by:
putin interfaceDtoCache- Parameters:
id- The identifier used to associate the DTO with a cached entry. This is typically a list of keys representing a unique identifier for the DTO.dto- The Data Transfer Object to store in the cache. It can benullif the entry should be removed or not stored.
-
getAll
Description copied from interface:DtoCacheRetrieves a list of all cached Data Transfer Objects (DTOs) of the specified class type. If no DTOs of the given type are found, this method returnsnull.
-