-
- private static boolean validationOfMultipartTypeAndRequestBody(@CheckForNull final MultipartType type,
- @CheckForNull final MultipartRequestBody body) {
- Preconditions.checkArgument(type != null, "Multipart Request can not by build without type!");
- Preconditions.checkArgument(body != null, "Multipart Request can not by build without body!");
- switch (type) {
- case OFPMPDESC:
- return body instanceof MultipartRequestDescCase;
- case OFPMPFLOW:
- return body instanceof MultipartRequestFlowCase;
- case OFPMPAGGREGATE:
- return body instanceof MultipartRequestAggregateCase;
- case OFPMPTABLE:
- return body instanceof MultipartRequestTableCase;
- case OFPMPPORTSTATS:
- return body instanceof MultipartRequestPortStatsCase;
- case OFPMPQUEUE:
- return body instanceof MultipartRequestQueueCase;
- case OFPMPGROUP:
- return body instanceof MultipartRequestGroupCase;
- case OFPMPGROUPDESC:
- return body instanceof MultipartRequestGroupDescCase;
- case OFPMPGROUPFEATURES:
- return body instanceof MultipartRequestGroupFeaturesCase;
- case OFPMPMETER:
- return body instanceof MultipartRequestMeterCase;
- case OFPMPMETERCONFIG:
- return body instanceof MultipartRequestMeterConfigCase;
- case OFPMPMETERFEATURES:
- return body instanceof MultipartRequestMeterFeaturesCase;
- case OFPMPTABLEFEATURES:
- return body instanceof MultipartRequestTableFeaturesCase;
- case OFPMPPORTDESC:
- return body instanceof MultipartRequestPortDescCase;
- case OFPMPEXPERIMENTER:
- return body instanceof MultipartRequestExperimenterCase;
- default:
- throw new IllegalArgumentException("Unknown MultipartType " + type);
- }
- }