20 lines
405 B
Java
Executable File
20 lines
405 B
Java
Executable File
package dev.dinauer.login;
|
|
|
|
import java.util.List;
|
|
|
|
import jakarta.enterprise.context.ApplicationScoped;
|
|
|
|
@ApplicationScoped
|
|
public class UserMapper
|
|
{
|
|
public User map(UserEntity user)
|
|
{
|
|
return new User(user.getUsername(), user.getEmail(), user.getRoles(), null);
|
|
}
|
|
|
|
public List<User> map(List<UserEntity> users)
|
|
{
|
|
return users.stream().map(this::map).toList();
|
|
}
|
|
}
|