Files
MoGoEagleEye/foudations/mogo-utils/src/main/java/com/mogo/utils/MapUtils.java
2019-12-23 15:08:04 +08:00

26 lines
764 B
Java

package com.mogo.utils;
import java.util.Map;
import java.util.Set;
/**
* Created by congtaowang on 2018/11/20.
*/
public class MapUtils {
public static void putNotAllowNull( final Map< String, Object > target, final String key, final Object value ) {
if ( target != null && key != null && value != null ) {
target.put( key, value );
}
}
public static void putAllNotAllowNull( final Map< String, Object > target, final Map< String, Object > source ) {
if ( target != null && source != null && !source.isEmpty() ) {
final Set< String > keys = source.keySet();
for ( String key : keys ) {
putNotAllowNull( target, key, source.get( key ) );
}
}
}
}