final ImmutableMap.Builder<KijiColumnName, KijiCellDecoder<?>> decoderMap =
ImmutableMap.builder();
for (KijiColumnName column : columns) {
// Gets the specification for this column,
// from the overlay map or else from the actual table layout:
CellSpec cellSpec = overrides.get(column);
if (null == cellSpec) {
cellSpec = layout.getCellSpec(column);
} else {
// Deep-copy the user-provided CellSpec:
cellSpec = CellSpec.copy(cellSpec);
}
// Fills in the missing details to build the decoder:
if (cellSpec.getSchemaTable() == null) {
cellSpec.setSchemaTable(schemaTable);
}
if (cellSpec.getDecoderFactory() == null) {
cellSpec.setDecoderFactory(factory);
}
final KijiCellDecoder<?> decoder = cellSpec.getDecoderFactory().create(cellSpec);
decoderMap.put(column, decoder);
}
return new CellDecoderProvider(
layout,
decoderMap.build(),