Export Premium names to Drive

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=212509587
This commit is contained in:
weiminyu 2018-09-11 13:29:45 -07:00 committed by Ben McIlwain
parent dbb1f1649d
commit 80b0e6297b
10 changed files with 393 additions and 7 deletions

View file

@ -213,6 +213,15 @@ public final class PremiumListUtils {
ofy().transactNew(() -> ofy().delete().key(premiumList.getRevisionKey()));
}
/**
* Returns all {@link PremiumListEntry PremiumListEntries} in the given {@code premiumList}.
*
* <p>This is an expensive operation and should only be used when the entire list is required.
*/
public static Iterable<PremiumListEntry> loadPremiumListEntries(PremiumList premiumList) {
return ofy().load().type(PremiumListEntry.class).ancestor(premiumList.revisionKey).iterable();
}
/** Returns whether a PremiumList of the given name exists, bypassing the cache. */
public static boolean doesPremiumListExist(String name) {
return ofy().load().key(Key.create(getCrossTldKey(), PremiumList.class, name)).now() != null;