Initial commit
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
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 ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user