if (correspondingIndexFieldDefinition == null) {
throw new MalformedIndexEntryException("Index entry contains a field that is not part of " +
"the index definition: " + fieldName);
} else if (fieldValue != null) {
final RowKey rowKey = correspondingIndexFieldDefinition.asRowKey();
if (!rowKey.getDeserializedClass().isAssignableFrom(fieldValue.getClass())) {
throw new MalformedIndexEntryException("Index entry for field " + fieldName + " contains" +
" a value of an incorrect type. Expected: " + rowKey.getDeserializedClass() +
", found: " + fieldValue.getClass().getName());
}
}
}