All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.comhix.web.auth.internal.UserProviderImpl Maven / Gradle / Ivy

There is a newer version: 1.6.3
Show newest version
package de.comhix.web.auth.internal;

import de.comhix.web.auth.UserProvider;

import javax.inject.Inject;
import javax.inject.Provider;
import javax.inject.Singleton;
import java.util.Optional;

/**
 * @author Benjamin Beeker
 */
@Singleton
public class UserProviderImpl implements UserProvider {
    private final Provider providerProvider;

    @Inject
    public UserProviderImpl(Provider providerProvider) {
        this.providerProvider = providerProvider;
    }

    public Optional getUser() {
        return Optional.ofNullable(providerProvider.get().getUser());
    }

    public void setUser(String user) {
        providerProvider.get().setUser(user);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy