}
final CellDecoderProvider requestDecoderProvider =
decoderProvider.getDecoderProviderForRequest(dataRequest);
final KijiDataRequest unpagedRequest = unpagedRequestBuilder.build();
final KijiDataRequest pagedRequest = pagedRequestBuilder.build();
if (unpagedRequest.isEmpty() && pagedRequest.isEmpty()) {
return new EmptyKijiResult<T>(entityId, dataRequest);
}
final MaterializedKijiResult<T> materializedKijiResult;
if (!unpagedRequest.isEmpty()) {
materializedKijiResult =
createMaterialized(
table.getURI(),
entityId,
unpagedRequest,
layout,
columnTranslator,
requestDecoderProvider,
table.getAdmin());
} else {
materializedKijiResult = null;
}
final CassandraPagedKijiResult<T> pagedKijiResult;
if (!pagedRequest.isEmpty()) {
pagedKijiResult =
new CassandraPagedKijiResult<T>(
entityId,
pagedRequest,
table,
layout,
columnTranslator,
requestDecoderProvider);
} else {
pagedKijiResult = null;
}
if (unpagedRequest.isEmpty()) {
return pagedKijiResult;
} else if (pagedRequest.isEmpty()) {
return materializedKijiResult;
} else {
return DefaultKijiResult.create(dataRequest, materializedKijiResult, pagedKijiResult);
}
}