public static @Nullable Response build(
@NotNull ArgScheme argScheme,
long id,
ResponseCode responseCode,
Map<String, String> transportHeaders,
ByteBuf arg2,
ByteBuf arg3
) {
final Response res;
switch (argScheme) {
case RAW:
res = new RawResponse(id, responseCode, transportHeaders, arg2, arg3);
break;
case JSON:
res = new JsonResponse<>(id, responseCode, transportHeaders, arg2, arg3);
break;
case THRIFT:
res = new ThriftResponse<>(id, responseCode, transportHeaders, arg2, arg3);
break;
default:
res = null;
break;
}
return res;
}