Interface UserService

All Known Implementing Classes:
UserServiceImpl

public interface UserService
This interface defines the contract for the User Service. It provides methods to perform CRUD operations on UserModel objects.
  • Method Details

    • save

      Saves a new UserModel object to the database.
      Parameters:
      user - The UserModel object to be saved.
      Returns:
      The saved UserModel object.
      Throws:
      GenericException - If an error occurs during the save operation.
    • findByIdOrUsernameContainsOrEmail

      List<UserModel> findByIdOrUsernameContainsOrEmail(Integer id, String username, String email)
      Retrieves a UserModel object by its id, username (partial match) and Email.
      Parameters:
      id - The id of the UserModel object to be retrieved.
      username - The username (partial) of the UserModel object to be retrieved.
      email - The email of the UserModel object to be retrieved.
      Returns:
      An Optional containing the UserModel object if found, otherwise an empty Optional.
    • findById

      Optional<UserModel> findById(Integer id)
      Retrieves a UserModel object by its ID.
      Parameters:
      id - The ID of the UserModel object to be retrieved.
      Returns:
      An Optional containing the UserModel object if found, otherwise an empty Optional.
    • findUserByEmail

      Optional<UserModel> findUserByEmail(String email)
      Retrieve a user by email.
      Parameters:
      email - user email
      Returns:
      Optional with user
    • deleteById

      void deleteById(Integer id)
      Delete user by Id provide.
      Parameters:
      id -