Implemented locale handling for sailorsInfoWebsiteURL selection and

moved the special locale dependent code for the legacy
sailorsInfoWebsiteURL field to the automatic porting code
This commit is contained in:
Steffen Schaefer committed 2016-02-24 13:12:55 +01:00
1 parent 34536402ef
commit 55fee62053
4 files changed
+29 -16

No files matched your search

@@ -99,6 +99,8 @@ public interface EventBase extends Named, WithDescription, Renamable, WithID, Wi
boolean hasSailorsInfoWebsiteURL(Locale locale);
void removeSailorsInfoWebsiteURL(Locale locale);
URL getSailorsInfoWebsiteURLOrFallback(Locale locale);
Iterable<? extends LeaderboardGroupBase> getLeaderboardGroups();
@@ -230,6 +230,17 @@ public abstract class EventBaseImpl implements EventBase {
public boolean hasSailorsInfoWebsiteURL(Locale locale) {
return this.sailorsInfoWebsiteURLs.containsKey(locale);
}
@Override
public URL getSailorsInfoWebsiteURLOrFallback(Locale locale) {
final URL result;
if(hasSailorsInfoWebsiteURL(locale)) {
result = this.sailorsInfoWebsiteURLs.get(locale);
} else {
result = this.sailorsInfoWebsiteURLs.get(null);
}
return result;
}
@Override
public Iterable<ImageDescriptor> getImages() {