INNER CODE UNIT · Java

ONLY_DIRECTORIES

SeaseLtd/rated-ranking-evaluator · rre-core/src/main/java/io/sease/rre/Func.java:43

    public static final FileFilter ONLY_DIRECTORIES = file -> file.isDirectory() && !file.isHidden();
    public static final FileFilter ONLY_NON_HIDDEN_FILES = file -> !file.isHidden();

    /**
     * Makes sure a non-null array is returned.
     * This is used in iterations, in order to avoid NPE.
     *
     * @param values the input array.
     * @param <T>    the array type.
     * @return the same array, if it's not null, an empty array otherwise.
     */
    public static <T> T[] safe(final T[] values) {
        return values != null ? values : emptyList().toArray(values);
    }

    /**
     * Makes sure a non-null array is returned.
     * This is used in iterations, in order to avoid NPE.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…