![JAR search and dependency download from the Maven repository](/logo.png)
com.github.andyshao.util.MapOperation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Gear Show documentation
Show all versions of Gear Show documentation
Enhance and formating the coding of JDK
The newest version!
package com.github.andyshao.util;
import com.github.andyshao.lang.Convert;
import com.github.andyshao.lang.StringOperation;
import com.github.andyshao.util.stream.Pair;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.function.Supplier;
/**
*
* Title:
* Descript:
* Copyright: Copryright(c) Apr 26, 2018
* Encoding:UNIX UTF-8
* @author Andy.Shao
*
*/
public final class MapOperation {
private MapOperation() {
}
/**
* of operation
* @param map {@link Map}
* @param key key
* @param value value
* @return origin {@link Map}
*/
@SuppressWarnings({"rawtypes", "unchecked"})
public static Map of(Map map, Object key, Object value){
map.put(key, value);
return map;
}
/**
* is empty or null
* @param map {@link Map}
* @return if it is then true
* @param key type
* @param value type
*/
public static final boolean isEmptyOrNull(Map map) {
return map == null || map.isEmpty();
}
/**
* convert map
* @param convert key & value {@link Convert}
* @param suplier {@link Map} factory
* @return the {@link Map}
* @param origin key type
* @param new key type
* @param origin value type
* @param new value type
* @param new {@link Map} type
*/
public static final > Convert
© 2015 - 2025 Weber Informatics LLC | Privacy Policy