com.github.iintelligas.persist.dto.RolePermissionDto Maven / Gradle / Ivy
package com.github.iintelligas.persist.dto;
import com.github.iintelligas.persist.entity.RoleEntity;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
public class RolePermissionDto implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
private String name;
private String description;
private Set permissions;
public RolePermissionDto() {
}
public RolePermissionDto(final RoleEntity role) {
this.id = role.getId();
this.name = role.getName();
this.description = role.getDescription();
}
public RolePermissionDto(Long id, String name, String description) {
this.id = id;
this.name = name;
this.description = description;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Set getPermissions() {
return permissions;
}
public void addPermission(Permission permission) {
if(permissions == null) {
permissions = new HashSet<>();
}
permissions.add(permission);
}
public void setPermissions(Set permissions) {
this.permissions = permissions;
}
@Override
public String toString() {
return "Role{" +
"id=" + id +
", name='" + name + '\'' +
", description='" + description + '\'' +
", permissions=" + permissions +
'}';
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy