-
-
Save pserwylo/f4b8d3a12a96ef375199 to your computer and use it in GitHub Desktop.
Downloaders without the base class having to implement UIL interface in the base class.
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
abstract class Downloader {} | |
abstract class CacheableDownloader extends Downloader { | |
abstract boolean isCached(); | |
abstract void setCacheIdentifier(String id) | |
} | |
class HTTPDownloader extends CacheableDownloader { | |
void setCacheIdentifier(String id) { | |
this.etag = id; | |
} | |
boolean isCached() { | |
return serverEtag.equals(this.etag); | |
} | |
} | |
class BluetoothDownloader extends Downloader {} | |
class IndexDownloader { | |
private Downloader downloader; | |
} | |
class ApkDownloader { | |
private Downloader downloader; | |
} | |
class UILDownloader implements uil.ImageDownloader { | |
private Downloader downloader; | |
public InputStream inputStream() { | |
return downloader.getInputStream() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment