/** * Creates a filter of the None type. * @return a newly created locale filter. */ public static LocaleFilter none() { return new LocaleFilter(FilterType.None); }
/** * Creates a filter of the Any type. * @return a newly created locale filter. */ public static LocaleFilter any() { return new LocaleFilter(); }
/** * Builds a filter from a configuration string. See {@link #fromString} for details on the string format. * @param string the parameters string. * @return a newly created locale filter object. */ public static LocaleFilter build(String string) { return new LocaleFilter(string); }
/** * Determines if a given string contains only explicitly listed locales. * If the given strin contains only explicitly listed locales (no regex patterns or masks), then returns * a string with a space-delimited list of locale tags of those locales. * If there's at least one mask or pattern, an empty string is returned. * @param string the given locale filter configuration string. See {@link #fromString} for details. * @return a string with a space-delimited list of locale tags allowed by this locale filter. */ public static String getExplicitLocaleIds(String string) { LocaleFilter filter = new LocaleFilter(string); return ListUtil.listAsString(filter.getExplicitLocaleIds(), " "); } }