io.github.mike10004.vhs.bmp.BmpResponseManufacturer Maven / Gradle / Ivy
package io.github.mike10004.vhs.bmp;
/**
* Interface that defines a method to manufacture responses that the proxy
* will send to the client.
*/
public interface BmpResponseManufacturer {
/**
* Manufactures a response for a given request.
* @param capture the request
* @return the response
*/
ResponseCapture manufacture(S state, RequestCapture capture);
S createFreshState();
default WithState withFreshState() {
return withState(createFreshState());
}
default WithState withState(S state) {
return request -> {
return manufacture(state, request);
};
}
interface WithState {
ResponseCapture invoke(RequestCapture request);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy