/** * Disallows the locales from a given set of locales. * @param localeIds the given set of locales. * @return this locale filter. */ public LocaleFilter exclude(Set<LocaleId> localeIds) { if (localeIds == null) return this; for (LocaleId localeId : localeIds) exclude(localeId); return this; }
/** * Disallows the locales from a given list of locales. * @param localeIds the given list of locales. * @return this locale filter. */ public LocaleFilter exclude(List<LocaleId> localeIds) { if (localeIds == null) return this; for (LocaleId localeId : localeIds) exclude(localeId); return this; }
/** * Creates a filter filtering out the given locales. * @param localeIds an array of the LocaleId objects to disallow. * @return a newly created locale filter. */ public static LocaleFilter anyExcept(LocaleId ... localeIds) { LocaleFilter filter = any(); filter.exclude(localeIds); return filter; }
/** * Disallows the locales from a given array of locales. * @param localeIds the given array of locales. * @return this locale filter. */ public LocaleFilter exclude(LocaleId ... localeIds) { if (Util.isEmpty(localeIds)) return this; for (LocaleId localeId : localeIds) exclude(localeId); return this; }
private void setLocale(boolean excludeMode, String language, String region) { if (Util.isEmpty(language)) return; if (Util.isEmpty(region)) return; if (excludeMode) exclude(new LocaleId(language, region)); else include(new LocaleId(language, region)); }
/** * Helper method. */ private void setLocale(boolean excludeMode, String language, String region, String userPart) { if (Util.isEmpty(language)) return; if (Util.isEmpty(region)) return; if (Util.isEmpty(userPart)) return; if (excludeMode) exclude(new LocaleId(language, region, userPart)); else include(new LocaleId(language, region, userPart)); }