public Statement withUpdatedParameters ( Value updates ) { if ( updates == null || updates . isEmpty ( ) ) { return this ; } else { Map < String , Value > newParameters = newHashMapWithSize ( Math . max ( parameters . size ( ) , updates . size ( ) ) ) ; newParameters . putAll ( parameters . asMap ( ofValue ( ) ) ) ; for ( Map . Entry < String , Value > entry : updates . asMap ( ofValue ( ) ) . entrySet ( ) ) { Value value = entry . getValue ( ) ; if ( value . isNull ( ) ) { newParameters . remove ( entry . getKey ( ) ) ; } else { newParameters . put ( entry . getKey ( ) , value ) ; } } return withParameters ( value ( newParameters ) ) ; } }
Create a new statement with new parameters derived by updating this statement s parameters using the given updates .