Getting confluence username from email

I am creating a custom endpoint in my confluence plugin through which I want to get a user’s username by supplying the email address of the user. I want to send the email as the parameter and want to get the username as the response.
Is there any Java API through which I can get the username of the user?