changeset 92:d1c2cf083c8d

additional toString methods.
author Robert Casties <casties@mpiwg-berlin.mpg.de>
date Fri, 08 Jun 2018 09:09:26 +0200
parents fa7b1058b776
children 7b95bd44caec
files src/main/java/org/mpi/openmind/repository/bo/Entity.java
diffstat 1 files changed, 12 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/org/mpi/openmind/repository/bo/Entity.java	Tue May 29 21:20:49 2018 +0200
+++ b/src/main/java/org/mpi/openmind/repository/bo/Entity.java	Fri Jun 08 09:09:26 2018 +0200
@@ -1051,7 +1051,7 @@
         String idString = (this.getId() == null) ? "" : "id=" + getId() + ", ";
         
         return "Entity[" + rowIdString + idString + "oc=" + this.getObjectClass() +  ", ov=" + this.getOwnValue() + ", user=" + getUser() +  ", sysStatus=" + this.getSystemStatus() +
-                ", type=" + this.getType() + " att.size=" + this.attributes.size() + "]";
+                ", type=" + this.getType() + " att.size=" + this.attributes.size() + " public=" + this.getIsPublic() + "]";
     }
 
     /**
@@ -1084,8 +1084,17 @@
         return "!!!ENCODING-ERROR!!!";
     }
 
-    public String getShortString(){
-    	return "[" + this.getId() + "] " + this.getOwnValue();
+    public String getShortString() {
+    	return "[" + this.getObjectClass() + " " + this.getId() + "] " + this.getOwnValue();
+    }
+    
+    public static String getShortStringList(List<Entity> entities) {
+        StringBuffer s = new StringBuffer();
+        for (Entity ent : entities) {
+            s.append((s.length() > 0) ? ", " : "");
+            s.append(ent.getShortString());
+        }
+        return s.toString();
     }
     
 	/* (non-Javadoc)