Mercurial > hg > openmind
changeset 84:68e3e4b569f9
add searchEntityByPublic().
author | Robert Casties <casties@mpiwg-berlin.mpg.de> |
---|---|
date | Mon, 10 Jul 2017 18:53:40 +0200 |
parents | 979604ccc6db |
children | 1aff84e5048d |
files | src/main/java/org/mpi/openmind/cache/WrapperService.java |
diffstat | 1 files changed, 20 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/org/mpi/openmind/cache/WrapperService.java Mon Jul 10 18:53:04 2017 +0200 +++ b/src/main/java/org/mpi/openmind/cache/WrapperService.java Mon Jul 10 18:53:40 2017 +0200 @@ -90,6 +90,26 @@ return rs; } + /** + * Returns a List with all entities having the given isPublic state. + * + * @param oc + * @param isPublic + * @return + */ + public List<Entity> searchEntityByPublic(String oc, Boolean isPublic) { + List<Entity> rs = new ArrayList<Entity>(); + + List<Entity> entList = this.cache.loadEntitiesByDef(oc); + + for (Entity ent : entList) { + if (ent.getIsPublic() == isPublic) { + rs.add(ent); + } + } + return rs; + } + // ************************************************************ // ************************************************************ // ************************************************************