Last active
February 9, 2017 00:51
-
-
Save yemyatthu1990/350a58820844d3b6d6f5ebc4bffbd4b9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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