1

Merge branch 'change-to-polymorphie' of https://github.com/hhu-propra2/abschlussprojekt-it-bois into change-to-polymorphie

This commit is contained in:
killerber4t
2020-03-16 15:53:03 +01:00
2 changed files with 11 additions and 10 deletions

View File

@ -3,6 +3,7 @@ package mops.gruppen2.domain.event;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import mops.gruppen2.domain.Group;
/** /**
* Ändert nur die Gruppenbeschreibung. * Ändert nur die Gruppenbeschreibung.
@ -13,13 +14,12 @@ import lombok.NoArgsConstructor;
public class UpdateGroupDescriptionEvent extends Event { public class UpdateGroupDescriptionEvent extends Event {
String newGroupDescription; String newGroupDescription;
public UpdateGroupDescriptionEvent(Long event_id, Long group_id, String user_id, String newGroupDescription) {
super(event_id, group_id, user_id);
this.newGroupDescription = newGroupDescription;
}
public UpdateGroupDescriptionEvent(Long group_id, String user_id, String newGroupDescription) { public UpdateGroupDescriptionEvent(Long group_id, String user_id, String newGroupDescription) {
super(group_id, user_id); super(group_id, user_id);
this.newGroupDescription = newGroupDescription; this.newGroupDescription = newGroupDescription;
} }
public void apply(Group group) {
group.setDescription(this.newGroupDescription);
}
} }

View File

@ -3,6 +3,7 @@ package mops.gruppen2.domain.event;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import mops.gruppen2.domain.Group;
/** /**
* Ändert nur den Gruppentitel. * Ändert nur den Gruppentitel.
@ -13,13 +14,13 @@ import lombok.NoArgsConstructor;
public class UpdateGroupTitleEvent extends Event { public class UpdateGroupTitleEvent extends Event {
String newGroupTitle; String newGroupTitle;
public UpdateGroupTitleEvent(Long event_id, Long group_id, String user_id, String newGroupTitle) {
super(event_id, group_id, user_id);
this.newGroupTitle = newGroupTitle;
}
public UpdateGroupTitleEvent(Long group_id, String user_id, String newGroupTitle) { public UpdateGroupTitleEvent(Long group_id, String user_id, String newGroupTitle) {
super(group_id, user_id); super(group_id, user_id);
this.newGroupTitle = newGroupTitle; this.newGroupTitle = newGroupTitle;
} }
public void apply(Group group) {
group.setTitle(this.newGroupTitle);
}
} }