Last active
March 31, 2020 22:07
-
-
Save brunoborges/7654e5373c88aa780a86a111fd23214d 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 ConsumeSingleton { | |
public ConsumeSingleton() { | |
HttpClient._.call(...); | |
HttpClient.get.call(...); | |
HttpClient.INSTANCE.call(...); | |
} | |
} |
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 enum HttpClient { | |
_; | |
private HttpClient() { | |
// setup | |
} | |
public int call(String method, String url) { | |
// ... | |
return 200; | |
} | |
} |
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 enum HttpClient { | |
get; | |
private HttpClient() { | |
// setup | |
} | |
public int call(String method, String url) { | |
// ... | |
return 200; | |
} | |
} |
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 enum HttpClient { | |
INSTANCE; | |
private HttpClient() { | |
// setup | |
} | |
public int call(String method, String url) { | |
// ... | |
return 200; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment