se.skltp.mb.svc.exception.UnreadDeleteException Maven / Gradle / Ivy
package se.skltp.mb.svc.exception;
import java.util.List;
import se.skltp.mb.types.entity.MessageMeta;
/**
* Exception thrown when an attempt is made to delete unread messages
*
* @author [email protected]
*/
public class UnreadDeleteException extends Exception {
private List unreadMessages;
public UnreadDeleteException(List unreadMessages) {
super("Attempting to delete unread messages!");
this.unreadMessages = unreadMessages;
}
public List getUnreadMessages() {
return unreadMessages;
}
public String getUnreadIdsAsCsv() {
StringBuilder sb = new StringBuilder();
for ( MessageMeta msg : unreadMessages ) {
if ( sb.length() > 0 ) {
sb.append(",");
}
sb.append(msg.getId());
}
return sb.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy