Added getFirstEntryOfMap
This commit is contained in:
parent
d8610c1f54
commit
5c644e8c1e
|
@ -2,6 +2,7 @@ package org.gcube.application.geoportalcommon.shared.geoportal;
|
|||
|
||||
import java.io.Serializable;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
public class DocumentDV implements Serializable {
|
||||
|
||||
|
@ -19,6 +20,14 @@ public class DocumentDV implements Serializable {
|
|||
public LinkedHashMap<String, Object> getDocumentAsMap() {
|
||||
return documentAsMap;
|
||||
}
|
||||
|
||||
public Entry<String, Object> getFirstEntryOfMap() {
|
||||
if(documentAsMap!=null && documentAsMap.size()>1) {
|
||||
return documentAsMap.entrySet().iterator().next();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getDocumentAsJSON() {
|
||||
return documentAsJSON;
|
||||
|
|
Loading…
Reference in New Issue