public CellDecoderProvider getDecoderProviderForRequest(
final KijiDataRequest request
) throws IOException {
final List<BoundColumnReaderSpec> readerSpecs = Lists.newArrayList();
for (Column columnRequest : request.getColumns()) {
final ColumnReaderSpec readerSpec = columnRequest.getReaderSpec();
if (readerSpec != null) {
final KijiColumnName column = columnRequest.getColumnName();
readerSpecs.add(BoundColumnReaderSpec.create(readerSpec, column));
}
}
if (readerSpecs.isEmpty()) {
return this;
}
final Map<KijiColumnName, KijiCellDecoder<?>> columnDecoders = Maps.newHashMap();
columnDecoders.putAll(this.mColumnDecoders);
for (BoundColumnReaderSpec readerSpec : readerSpecs) {
columnDecoders.put(readerSpec.getColumn(), getDecoder(readerSpec));
}
return new CellDecoderProvider(
mLayout,
ImmutableMap.copyOf(columnDecoders),