public MapBuilder addMap ( String fieldName , boolean include , Supplier < Map < String , ? > > supplier ) { if ( include ) { Map < String , ? > value = supplier . get ( ) ; if ( value != null && ! value . isEmpty ( ) ) { map . put ( getFieldName ( fieldName ) , value ) ; } } return this ; }
Adds the map value to the provided map under the provided field name if it should be included . The supplier is only invoked if the field is to be included .