added setOptionalMessage and optional Document

This commit is contained in:
Francesco Mangiacrapa 2024-04-09 16:10:36 +02:00
parent 33fcdfef3c
commit 8f72db0391
1 changed files with 14 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map.Entry;
import org.bson.Document;
import org.gcube.application.geoportal.common.model.document.Project;
import org.gcube.application.geoportal.common.model.document.accounting.Context;
import org.gcube.application.geoportal.common.model.document.accounting.User;
@ -26,6 +27,7 @@ public class ItemObserved<T extends Project> implements ItemObservable {
UseCaseDescriptor useCaseDescriptor;
T project;
EventManager.Event event;
Document optional;
public String getProjectId() {
log.debug("Called getProjectId");
@ -65,6 +67,18 @@ public class ItemObserved<T extends Project> implements ItemObservable {
return documentAsMap;
}
public void setOptionalMessage(String message){
this.optional = new Document();
this.optional.put("message", message);
}
public String getOptionalMessage(){
if(this.optional!=null) {
return (String) this.optional.getOrDefault("message", null);
}
return null;
}
@Override
public String toString() {