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

org.codegas.commons.lang.value.PrincipalName Maven / Gradle / Ivy

There is a newer version: 3.0.0
Show newest version
package org.codegas.commons.lang.value;

import java.security.Principal;
import java.util.Objects;

public final class PrincipalName extends AbstractId {

    private String value;

    public static PrincipalName fromString(String string) {
        return string == null ? null : new PrincipalName(string);
    }

    public static PrincipalName fromPrincipal(Principal principal) {
        return principal == null ? null : new PrincipalName(principal.getName());
    }

    public PrincipalName(String value) {
        this.value = Objects.requireNonNull(value);
    }

    protected PrincipalName() {

    }

    @Override
    public Object idHash() {
        return value;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy