public ExecutionContext with ( String key , String value ) { Map < String , String > newData = data ; if ( value == null ) { // Remove the value with the key ... if ( this . data . isEmpty ( ) || ! this . data . containsKey ( key ) ) { // nothing to remove return this ; } newData = new HashMap < String , String > ( data ) ; newData . remove ( key ) ; newData = Collections . unmodifiableMap ( newData ) ; } else { // We are to add the value ... newData = new HashMap < String , String > ( data ) ; newData . put ( key , value ) ; newData = Collections . unmodifiableMap ( newData ) ; } return new ExecutionContext ( securityContext , namespaceRegistry , propertyFactory , threadPools , binaryStore , newData , processId , decoder , encoder , stringFactory , binaryFactory , booleanFactory , dateFactory , decimalFactory , doubleFactory , longFactory , nameFactory , pathFactory , referenceFactory , weakReferenceFactory , simpleReferenceFactory , uriFactory , objectFactory , locale ) ; }
Create a new execution context that mirrors this context but that contains the supplied key - value pair in the new context s data .