Mercurial > hg > openmind
comparison src/main/java/org/mpi/openmind/cache/WrapperService.java @ 84:68e3e4b569f9
add searchEntityByPublic().
author | Robert Casties <casties@mpiwg-berlin.mpg.de> |
---|---|
date | Mon, 10 Jul 2017 18:53:40 +0200 |
parents | ab61cd3ad0e0 |
children |
comparison
equal
deleted
inserted
replaced
83:979604ccc6db | 84:68e3e4b569f9 |
---|---|
82 term = NormalizerUtils.normalize(term); | 82 term = NormalizerUtils.normalize(term); |
83 | 83 |
84 for(Entity ent : entList){ | 84 for(Entity ent : entList){ |
85 if(StringUtils.isNotEmpty(ent.getNormalizedOwnValue()) && | 85 if(StringUtils.isNotEmpty(ent.getNormalizedOwnValue()) && |
86 StringUtils.contains(ent.getNormalizedOwnValue(), term)){ | 86 StringUtils.contains(ent.getNormalizedOwnValue(), term)){ |
87 rs.add(ent); | |
88 } | |
89 } | |
90 return rs; | |
91 } | |
92 | |
93 /** | |
94 * Returns a List with all entities having the given isPublic state. | |
95 * | |
96 * @param oc | |
97 * @param isPublic | |
98 * @return | |
99 */ | |
100 public List<Entity> searchEntityByPublic(String oc, Boolean isPublic) { | |
101 List<Entity> rs = new ArrayList<Entity>(); | |
102 | |
103 List<Entity> entList = this.cache.loadEntitiesByDef(oc); | |
104 | |
105 for (Entity ent : entList) { | |
106 if (ent.getIsPublic() == isPublic) { | |
87 rs.add(ent); | 107 rs.add(ent); |
88 } | 108 } |
89 } | 109 } |
90 return rs; | 110 return rs; |
91 } | 111 } |