Class User
java.lang.Object
dev.fernando.user_authentication_api.model.User
- All Implemented Interfaces:
Serializable
,org.springframework.security.core.userdetails.UserDetails
@Entity
public class User
extends Object
implements org.springframework.security.core.userdetails.UserDetails
Represents a user in the system.
Implements UserDetails for Spring Security integration.
Contains user information such as username, email, password, phone, cpf, birthday date, and user role.
Provides methods to convert to DTOs and manage user roles.
- Since:
- 1.0.0
- Author:
- Fernando Cruz Cavina
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionConverts the User entity to a UserEventDto.Collection
<? extends org.springframework.security.core.GrantedAuthority> Converts the User entity to a ViewUserDto.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.security.core.userdetails.UserDetails
getPassword, getUsername, isAccountNonExpired, isAccountNonLocked, isCredentialsNonExpired, isEnabled
-
Constructor Details
-
User
-
User
-
User
-
User
-
User
-
-
Method Details
-
getAuthorities
- Specified by:
getAuthorities
in interfaceorg.springframework.security.core.userdetails.UserDetails
-
convertToUserEventDto
Converts the User entity to a UserEventDto. This method is used to prepare user data for event publishing, such as account creation or updates.- Returns:
-
toViewUserDto
Converts the User entity to a ViewUserDto. This method is used to prepare user data for API responses.- Returns:
- a ViewUserDto object containing user details
-