/*
 * @author Ranides Atterwim {@literal <ranides@gmail.com>}
 * @copyright Ranides Atterwim
 * @license WTFPL
 * @url http://ranides.net/projects/assira
 */
package net.ranides.assira.credentials;

import java.net.URI;
import java.util.function.Predicate;

import lombok.experimental.UtilityClass;
import net.ranides.assira.collection.prototype.GenericKey;

/**
 * A bunch of generic keys commonly used to describe user account
 *
 * @author Ranides Atterwim {@literal <ranides@gmail.com>}
 */
@UtilityClass
public class UserProperty {

    /**
     * Unique account identifier: most of the time equivalent to login
     */
    public static final GenericKey<String,String> ACCOUNT = GenericKey.of(String.class, "account");

    /**
     * User domain: especially windows domain
     */
    public static final GenericKey<String,String> DOMAIN = GenericKey.of(String.class, "user.domain");

    /**
     * User login
     */
    public static final GenericKey<String,String> LOGIN = GenericKey.of(String.class, "user.login");

    /**
     * User password
     */
    public static final GenericKey<String,String> PASSWORD = GenericKey.of(String.class, "user.password");

    /**
     * User e-mail
     */
    public static final GenericKey<String,String> EMAIL = GenericKey.of(String.class, "user.e-mail");

    /**
     * Some credentials are assigned to specific host:port
     * For example, it is common in password managers
     */
    public static final GenericKey<String,String> HOST = GenericKey.of(String.class, "addr.host");

    /**
     * Some credentials are assigned to specific host:port
     * For example, it is common in password managers
     */
    public static final GenericKey<String,Integer> PORT = GenericKey.of(Integer.class, "addr.port");

    /**
     * Some credentials are assigned to specific URL
     * For example, it is common in password managers
     */
    public static final GenericKey<String,Predicate<URI>> URI = new GenericKey<String,Predicate<URI>>("addr.uri"){};

    /**
     * Some accounts are automatically generated
     * For example, extracted from URI scheme. We mark those account using this property
     */
    public static final GenericKey<String,Boolean> SYNTHETIC = GenericKey.of(Boolean.class, "user.synthetic");
    
}
