Example usage for java.util Map isEmpty

List of usage examples for java.util Map isEmpty

Introduction

In this page you can find the example usage for java.util Map isEmpty.

Prototype

boolean isEmpty();

Source Link

Document

Returns true if this map contains no key-value mappings.

Usage

From source file:Main.java

public static boolean isMapEmpty(Map<?, ?> map) {

    return map == null || map.isEmpty();
}

From source file:Main.java

public static boolean isEmpty(Map<?, ?> map) {
    return (map == null || map.isEmpty());
}

From source file:Main.java

public static final boolean isEmptyMap(Map<?, ?> map) {
    if (map == null || map.isEmpty()) {
        return true;
    }/*from w w  w.  j av a2 s .c o m*/

    return false;
}

From source file:Main.java

public static boolean isNullOrEmpty(Map<?, ?> map) {
    return map == null || map.isEmpty();
}

From source file:Main.java

public static String joinMap(Map<?, ?> map) {
    if (map.isEmpty()) {
        return "";
    }//from   w  w  w .  j ava  2s. c o  m
    StringBuilder stringBuilder = new StringBuilder();
    boolean notFirst = false;
    for (Map.Entry<?, ?> entry : map.entrySet()) {
        if (notFirst) {
            stringBuilder.append(',');
        }
        stringBuilder.append(entry.getKey().toString()).append(':').append(entry.getValue().toString());
        notFirst = true;
    }
    return stringBuilder.toString();
}

From source file:Main.java

public static String mapToString(Map<?, ?> map) {
    if (map.isEmpty()) {
        return "";
    }//from  w  w w  . j a v  a  2 s  . c o  m
    StringBuilder stringBuilder = new StringBuilder();
    boolean notFirst = false;
    for (Map.Entry<?, ?> entry : map.entrySet()) {
        if (notFirst) {
            stringBuilder.append(',');
        }
        stringBuilder.append(entry.getKey().toString()).append(':').append(entry.getValue().toString());
        notFirst = true;
    }
    return stringBuilder.toString();
}

From source file:Main.java

public static boolean isEmpty(Map<?, ?> map) {
    return (map == null) || map.isEmpty();
}

From source file:Main.java

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

From source file:Main.java

public static boolean empty(Map<?, ?> map) {
    return map == null || map.isEmpty();
}

From source file:Main.java

@SuppressWarnings("rawtypes")
public static boolean isEmpty(Map map) {
    return (map == null) || map.isEmpty();
}