Class RealmNestedPrincipal
- java.lang.Object
-
- org.wildfly.security.auth.principal.RealmNestedPrincipal
-
- All Implemented Interfaces:
Serializable,Principal
public final class RealmNestedPrincipal extends Object implements Principal, Serializable
A principal type which is used to find a specific identity in a specific realm. This principal can be used to locate an exact identity whose name may have changed or may be unknown, but which can be located another way (for example, by primary key).- Author:
- David M. Lloyd
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RealmNestedPrincipal(String realmName, Principal nestedPrincipal)Construct a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Determine whether this principal is equal to the given object.booleanequals(RealmNestedPrincipal obj)Determine whether this principal is equal to the given object.StringgetName()Returns the name of this principal, which is composed of the realm name and the name of the nested principal.PrincipalgetNestedPrincipal()Get the nested principal.<P extends Principal>
PgetNestedPrincipal(Class<P> principalClass)Get the nested principal if it is of the given type class.StringgetRealmName()Get the realm name.inthashCode()Get the hash code of this principal.StringtoString()Get this principal as a string.
-
-
-
Method Detail
-
getRealmName
public String getRealmName()
Get the realm name.- Returns:
- the realm name (not
null)
-
getNestedPrincipal
public Principal getNestedPrincipal()
Get the nested principal.- Returns:
- the nested principal (not
null)
-
getNestedPrincipal
public <P extends Principal> P getNestedPrincipal(Class<P> principalClass)
Get the nested principal if it is of the given type class.- Returns:
- the nested principal, or
nullif the nested principal is not of the given type
-
getName
public String getName()
Returns the name of this principal, which is composed of the realm name and the name of the nested principal.
-
hashCode
public int hashCode()
Get the hash code of this principal.
-
equals
public boolean equals(Object obj)
Determine whether this principal is equal to the given object.
-
equals
public boolean equals(RealmNestedPrincipal obj)
Determine whether this principal is equal to the given object.- Parameters:
obj- the object- Returns:
trueif they are equal,falseotherwise
-
-