/** * Returns cached <code>DateFormatSymbols</code> instance for specified locale. */ public static DateFormatSymbolsEx getDateFormatSymbols(Locale locale) { LocaleData localeData = lookupLocaleData(locale); DateFormatSymbolsEx dfs = localeData.dateFormatSymbols; if (dfs == null) { dfs = new DateFormatSymbolsEx(locale); localeData.dateFormatSymbols = dfs; } return dfs; }
/** * Matches path against pattern using *, ? and ** wildcards. * Both path and the pattern are tokenized on path separators (both \ and /). * '**' represents deep tree wildcard, as in Ant. */ public static boolean matchPath(String path, String pattern) { String[] pathElements = StringUtil.splitc(path, PATH_SEPARATORS); String[] patternElements = StringUtil.splitc(pattern, PATH_SEPARATORS); return matchTokens(pathElements, patternElements); }
/** * Reads string element from the annotation. Empty strings are detected * and default value is returned instead. */ protected String readString(A annotation, String name, String defaultValue) { String value = readStringElement(annotation, name); if (StringUtil.isEmpty(value)) { value = defaultValue; } return value; }
@SuppressWarnings("unchecked") public void registerAddonConverter(TypeConverter<File> fileTypeConverter) { if (addonFileConverters == null) { addonFileConverters = new TypeConverter[0]; } addonFileConverters = ArraysUtil.append(addonFileConverters, fileTypeConverter); }
/** * Indicates whether the given character is in the <i>reserved</i> set. * * @see <a href="http://www.ietf.org/rfc/rfc3986.txt">RFC 3986, appendix A</a> */ protected static boolean isReserved(char c) { return isGenericDelimiter(c) || isSubDelimiter(c); }
/** * Returns <code>true</code> if an array contains given value. */ public static boolean contains(byte[] array, byte value) { return indexOf(array, value) != -1; } /**
/** * Opens a resource of the specified name for reading. * @see #getResourceAsStream(String, ClassLoader, boolean) */ public static InputStream getResourceAsStream(String resourceName, boolean useCache) throws IOException { return getResourceAsStream(resourceName, null, useCache); }
/** * Calculates hash code for char array. */ public static int hashCharArray(int seed, char... charArray) { return hash(seed, charArray); }
private static boolean hasUnsafe0() { if (isHostAndroid()) { return false; } try { return PlatformInternal.hasUnsafe(); } catch (Throwable t) { return false; } }
/** * Generate a salt for use with the BCrypt.hashpw() method, * selecting a reasonable default for the number of hashing * rounds to apply. * * @return an encoded salt value */ public static String gensalt() { return gensalt(GENSALT_DEFAULT_LOG2_ROUNDS); }
/** * Defines exclude patterns. */ public T exclude(String... patterns) { for (String pattern : patterns) { rules.exclude(pattern); } return (T) this; }
/** * Defines included property names. */ public T include(String... includes) { for (String in : includes) { rules.include(in); } return (T) this; }
/** * Retrieves resource as file. * @see #getResourceFile(String) */ public static File getResourceFile(String resourceName) { return getResourceFile(resourceName, null); }
/** * Returns <code>true</code> if <code>double</code> array contains given value. */ public static boolean contains(double[] array, double value) { return indexOf(array, value) != -1; } /**
/** * Calculates hash code for byte array. */ public static int hashByteArray(int seed, byte... byteArray) { return hash(seed, byteArray); }
/** * Specify excluded jars. */ public void setExcludedJars(String... excludedJars) { for (String excludedJar : excludedJars) { rulesJars.exclude(excludedJar); } }
/** * Sets included set of names that will be considered during configuration. * @see jodd.util.InExRules */ public void setIncludedEntries(String... includedEntries) { for (String includedEntry : includedEntries) { rulesEntries.include(includedEntry); } }
/** * Calculates hash code for float array. */ public static int hashFloatArray(int seed, float... floatArray) { return hash(seed, floatArray); }