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

io.quarkus.security.identity.request.BaseAuthenticationRequest Maven / Gradle / Ivy

There is a newer version: 2.1.0
Show newest version
package io.quarkus.security.identity.request;

import java.util.HashMap;
import java.util.Map;

/**
 * Base implementation of the {@link AuthenticationRequest} interface for convenience.
 */
public abstract class BaseAuthenticationRequest implements AuthenticationRequest {

    private Map attributes;

    private Map attributes() {
        if (attributes == null) {
            attributes = new HashMap<>();
        }
        return attributes;
    }

    @Override
    public  T getAttribute(String name) {
        return attributes != null ? ((T) attributes.get(name)) : null;
    }

    @Override
    public void setAttribute(String name, Object value) {
        attributes().put(name, value);
    }

    @Override
    public Map getAttributes() {
        return attributes();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy