removed final modifier from aggregate-id
This commit is contained in:
@ -11,11 +11,7 @@ import java.lang.reflect.Method;
|
|||||||
public abstract class Aggregate {
|
public abstract class Aggregate {
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
protected final long id;
|
protected long id;
|
||||||
|
|
||||||
protected Aggregate(long id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ruft die spezifische applyEvent-Methode im entsprechenden Aggregat auf.
|
* Ruft die spezifische applyEvent-Methode im entsprechenden Aggregat auf.
|
||||||
|
|||||||
@ -14,17 +14,19 @@ import java.util.*;
|
|||||||
public class Group extends Aggregate {
|
public class Group extends Aggregate {
|
||||||
private String title;
|
private String title;
|
||||||
private String description;
|
private String description;
|
||||||
private List<User> members;
|
private final List<User> members;
|
||||||
private Map<User, Role> roles;
|
private final Map<User, Role> roles;
|
||||||
|
|
||||||
public Group(CreateGroupEvent event) {
|
public Group() {
|
||||||
super(event.getGroup_id());
|
|
||||||
this.title = event.getGroupTitle();
|
|
||||||
this.description = event.getGroupDescription();
|
|
||||||
this.members = new ArrayList<>();
|
this.members = new ArrayList<>();
|
||||||
this.roles = new HashMap<>();
|
this.roles = new HashMap<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void applyEvent(CreateGroupEvent event) {
|
||||||
|
title = event.getGroupTitle();
|
||||||
|
description = event.getGroupDescription();
|
||||||
|
}
|
||||||
|
|
||||||
private void applyEvent(UpdateRoleEvent event) {
|
private void applyEvent(UpdateRoleEvent event) {
|
||||||
User user;
|
User user;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user