Skip to content

Instantly share code, notes, and snippets.

@brunoborges
Last active March 31, 2020 22:07
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 brunoborges/7654e5373c88aa780a86a111fd23214d to your computer and use it in GitHub Desktop.
Save brunoborges/7654e5373c88aa780a86a111fd23214d to your computer and use it in GitHub Desktop.
public class ConsumeSingleton {
public ConsumeSingleton() {
HttpClient._.call(...);
HttpClient.get.call(...);
HttpClient.INSTANCE.call(...);
}
}
public enum HttpClient {
_;
private HttpClient() {
// setup
}
public int call(String method, String url) {
// ...
return 200;
}
}
public enum HttpClient {
get;
private HttpClient() {
// setup
}
public int call(String method, String url) {
// ...
return 200;
}
}
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