+ if (localeToTitle.size() != 1)
+ throw new RuntimeException("there shall be exactly one title");
+
+ return localeToTitle.values().iterator().next();
+ }
+
+ public String getTitle(final Locale locale) {
+ return localeToTitle.get(locale);
+ }
+
+ private void initializeLocalizedTitles(final String... titles) {
+ final Locale[] locales = getLocaleOrder();
+ if (locales.length != titles.length)
+ throw new RuntimeException("There should be exactly "
+ + locales.length + " title(s).");
+
+ for (int i = 0; i < titles.length; i++)
+ localeToTitle.put(locales[i], titles[i]);