Short answer: No. Lambda expressions are code, and must be compiled, so you're not going to be able to just configure them. This is not like regular expressions.
Longer answer: First, see if you can express the changes you anticipate as configuration, then configure just these variables. This is only possible if you are able to anticipate the changes, and these are data-driven rather than structural.
Second, you can use a strategy pattern with a factory to allow different implementations to be substituted at runtime. This would allow you to drop in new implementations without rebuilding the full code base:
public class ConfigurableFactory {
private final String strategyClassImpl;
public static void main(String[] args) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
System.out.println(new ConfigurableFactory().getStrategyImpl().doThing());
}
public ConfigurableFactory(){
// TODO: Load from config
strategyClassImpl ="StrategyImpl";
}
public Strategy getStrategyImpl() throws InstantiationException, IllegalAccessException, ClassNotFoundException{
return (Strategy) Class.forName(strategyClassImpl).newInstance();
}
}
interface Strategy {
String doThing();
}
class StrategyImpl implements Strategy {
public String doThing() {
return "Strategy 1";
}
}
This isn't specific to lambda expressions, and in real development I've always found it more acceptable to just change the code and rebuild than any kind of hot-deploying trickery.