package com.sourcefellows.patterns.singleton;

public class HTTPClient {

    // Statische Instanz
    static HTTPClient instance = new HTTPClient();

    // Privater Konstruktor
    private HTTPClient() {
    }

    public static HTTPClient getInstance() {

        if (instance == null) {
            // Instanzerzeugung
            instance = new HTTPClient();
            // direkte Ausführung
            instance.authenticate();
        }

        return instance;
    }

    public void authenticate() {
        System.out.println("authenticate");
    }

    public void sendData(Object data) {
        System.out.println(data);
    }
}
