140141142143144145146147
public Entity get(Transaction arg0, Key arg1) throws EntityNotFoundException { Entity e = store.get(arg1.toString()); if (e == null) throw new EntityNotFoundException(arg1); return e; }
5960616263646566676869
getImpl(datastore, ImmutableList.of(key))) { @Override protected Entity wrap(Map<Key, Entity> entityMap) throws Exception { Entity entity = entityMap.get(key); if (entity == null) { throw new EntityNotFoundException(key); } return entity; } }; }
535455565758596061
private Entity getImpl(DatastoreService datastore, Key key) throws EntityNotFoundException { checkNotNull(datastore); checkNotNull(key); Entity result = getImpl(datastore, ImmutableList.of(key)).get(key); if (result == null) { throw new EntityNotFoundException(key); } return result; }
227228229230231232233234235236237
@Override protected Entity wrap(Map<Key, Entity> entities) throws Exception { Entity ent = entities.get(key); if (ent == null) throw new EntityNotFoundException(key); else return ent; } }; }
145146147148149150151152153
{ // This one is a little tricky because of the declared exception Map<Key, Entity> result = this.get(txn, Collections.singleton(key)); Entity ent = result.get(key); if (ent == null) throw new EntityNotFoundException(key); else return ent; }