Skip to content

Instantly share code, notes, and snippets.

@yemyatthu1990
Last active February 9, 2017 00:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yemyatthu1990/350a58820844d3b6d6f5ebc4bffbd4b9 to your computer and use it in GitHub Desktop.
Save yemyatthu1990/350a58820844d3b6d6f5ebc4bffbd4b9 to your computer and use it in GitHub Desktop.
public class TownshipDataStoreFactory {
private final TownshipCache townshipCache;
public TownshipDataStoreFactory(TownshipCache townshipCache){
this.townshipCache = townshipCache;
}
public TownshipDataStore create(){
if(!townshipCache.isExpired() && townshipCache.isCached()){
return new TownshipLocalDataStore(townshipCache);
}else{
return new TownshipCloudDataStore(townshipCache);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment