Java Collection Empty isNonEmpty(final Collection values)

Here you can find the source of isNonEmpty(final Collection values)

Description

is Non Empty

License

Apache License

Declaration

public static boolean isNonEmpty(final Collection values) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Collection;

import java.util.Map;

public class Main {
    public static boolean isNonEmpty(final String value) {
        return !isEmpty(value);
    }//  w ww .ja  va  2  s .com

    public static boolean isNonEmpty(final Collection values) {
        return !isEmpty(values);
    }

    public static boolean isNonEmpty(final Map values) {
        return !isEmpty(values);
    }

    public static boolean isEmpty(final String value) {
        if (value == null) {
            return true;
        } else {
            return value.trim().isEmpty();
        }
    }

    public static boolean isEmpty(final Collection values) {
        return (values == null) || values.isEmpty();
    }

    public static boolean isEmpty(final Map values) {
        return (values == null) || values.isEmpty();
    }
}

Related

  1. isEmptyCollection(Object object)
  2. isEmptyException(Collection collection)
  3. isEmptyNotesField(Collection col)
  4. isEmptyString(Collection theCollection)
  5. isNonEmpty(Collection coll)
  6. isNotEmpty(@SuppressWarnings("rawtypes") Collection collection)
  7. isNotEmpty(Collection c)
  8. isNotEmpty(Collection collection)
  9. isNotEmpty(Collection collection)

  10. HOME | Copyright © www.java2s.com 2016