mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-15 00:58:24 +00:00
249efd1e71
Co-authored-by: Ilkka Seppälä <iluwatar@users.noreply.github.com>
27 lines
574 B
Java
27 lines
574 B
Java
package com.iluwatar;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import lombok.Getter;
|
|
import lombok.NoArgsConstructor;
|
|
|
|
/**
|
|
* The notification. Used for storing errors and any other methods
|
|
* that may be necessary for when we send information back to the
|
|
* presentation layer.
|
|
*/
|
|
@Getter
|
|
@NoArgsConstructor
|
|
public class Notification {
|
|
|
|
private final List<NotificationError> errors = new ArrayList<>();
|
|
|
|
public boolean hasErrors() {
|
|
return !this.errors.isEmpty();
|
|
}
|
|
|
|
public void addError(NotificationError error) {
|
|
this.errors.add(error);
|
|
}
|
|
}
|