Mercurial > dive4elements > river
diff flys-client/src/main/java/de/intevation/flys/client/shared/model/ThemeList.java @ 1473:71ba43bd0e3f
Added convenient accessor.
flys-client/trunk@3518 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Thu, 22 Dec 2011 08:53:15 +0000 |
parents | 1d82a2c695a6 |
children | e0f4ea518d59 |
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/shared/model/ThemeList.java Thu Dec 22 07:17:52 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/ThemeList.java Thu Dec 22 08:53:15 2011 +0000 @@ -35,6 +35,22 @@ /** + * Returns (first) theme of which the artifact has given uuid, null if none + * found. + * @param uuid Artifacts identifier for which to search theme. + * @return theme of which getArtifact() equals given uuid. + */ + public Theme getTheme(String uuid) { + for (Theme theme: themes) { + if (theme.getArtifact().equals(uuid)) { + return theme; + } + } + return null; + } + + + /** * Returns a theme at a specific position. <b>NOTE: Themes start at position * 1. So, take care in loops, that might start at index 0!</b> *