io.snice.protocol.Request Maven / Gradle / Ivy
package io.snice.protocol;
public interface Request extends Transaction {
/**
* Create a new final {@link Response} with no payload.
*
* @return
*/
Response.Builder buildResponse();
Response createResponse();
Response.Builder buildResponse(T payload);
@Override
default boolean isRequest() {
return true;
}
@Override
default Request toRequest() {
return this;
}
interface Builder {
/**
* Specify the {@link TransactionId}.
*
* If not specified, the default {@link TransactionId} implementation will be used,
* which is obtained through {@link TransactionId#generateDefault()}.
*/
Builder withTransactionId(TransactionId id);
Request build();
}
}