MemoryUserRepository

Development-only in-memory implementation of UserRepository.

This adapter provides an in-memory storage solution for User entities, primarily for use in development and testing environments. It avoids the need for a persistent database during local execution.

Annotations:

  • @Singleton: Marks this class as a singleton bean in the Micronaut application context.

  • @Requires(env = "dev"): Ensures this implementation is only active in the "dev" environment.

Inheritors

Properties

Link copied to clipboard

Backing in-memory key-value repository used to store User entities by UserId.

Functions

Link copied to clipboard
open override fun delete(entity: User)

Deletes an existing user entity from the in-memory repository.

Link copied to clipboard
open override fun findByEmail(email: String): User?

Finds a user by their email address.

Link copied to clipboard
open override fun findById(id: UserId): User?

Finds a user by its identifier.

Link copied to clipboard
open override fun findByUsername(username: String): User?

Finds a user by their username.

Link copied to clipboard
open override fun save(entity: User)

Persists a new user entity in the in-memory repository.

Link copied to clipboard
open override fun update(entity: User)

Updates an existing user entity in the in-memory repository.