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

restx.security.DefaultSessionDefinitionEntry Maven / Gradle / Ivy

There is a newer version: 1.2.0-rc2
Show newest version
package restx.security;

import com.google.common.base.Function;
import com.google.common.base.Optional;
import restx.security.RestxSession.Definition.Entry;

/**
 * Date: 20/1/15
 * Time: 20:56
 */
public class DefaultSessionDefinitionEntry implements Entry {
    private final String sessionDefKey;
    private final Function> function;

    public DefaultSessionDefinitionEntry(Class clazz, String sessionDefKey, Function> function) {
        this.sessionDefKey = sessionDefKey;
        this.function = function;
    }

    @Override
    public String getKey() {
        return sessionDefKey;
    }

    @Override
    public Optional getValueForId(String valueId) {
        return function.apply(valueId);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy