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 ) ); } } } }