public static Predicate disallowEmpty()

in hugegraph-common/src/main/java/org/apache/hugegraph/config/OptionChecker.java [31:44]


    public static <O> Predicate<O> disallowEmpty() {
        return o -> {
            if (o == null) {
                return false;
            }
            if (o instanceof String) {
                return StringUtils.isNotBlank((String) o);
            }
            if (o.getClass().isArray() && (Array.getLength(o) == 0)) {
                return false;
            }
            return !(o instanceof Iterable) || ((Iterable<?>) o).iterator().hasNext();
        };
    }