1 package de.dlr.shepard.neo4Core.io;
2
3 import de.dlr.shepard.neo4Core.entities.User;
4 import de.dlr.shepard.neo4Core.entities.UserGroup;
5 import io.swagger.v3.oas.annotations.media.Schema;
6 import jakarta.validation.constraints.NotNull;
7 import lombok.Data;
8 import lombok.EqualsAndHashCode;
9 import lombok.NoArgsConstructor;
10
11 @Data
12 @EqualsAndHashCode(callSuper = true)
13 @NoArgsConstructor
14 @Schema(name = "UserGroup")
15 public class UserGroupIO extends BasicEntityIO {
16
17 @NotNull
18 private String[] usernames;
19
20 public UserGroupIO(UserGroup userGroup) {
21 super(userGroup);
22 this.usernames = userGroup.getUsers().stream().map(User::getUsername).toArray(String[]::new);
23 }
24
25 }