public DatabaseObject snapshot(DatabaseObject example, DatabaseSnapshot snapshot, SnapshotGeneratorChain chain) throws DatabaseException, InvalidExampleException {
if (defaultFor != null && defaultFor.isAssignableFrom(example.getClass())) {
return snapshotObject(example, snapshot);
}
DatabaseObject chainResponse = chain.snapshot(example, snapshot);
if (chainResponse == null) {
return null;
}
if (shouldAddTo(example.getClass(), snapshot)) {