public class CassandraPrincipal
extends java.lang.Object
implements java.security.Principal, java.io.Serializable
This class implements the Principal
interface
and represents a user.
Principals such as this CassPrincipal
may be associated with a particular Subject
to augment that Subject
with an additional
identity. Refer to the Subject
class for more information
on how to achieve this. Authorization decisions can then be based upon
the Principals associated with a Subject
.
Principal
,
Subject
,
Serialized FormConstructor and Description |
---|
CassandraPrincipal(java.lang.String name)
Create a CassPrincipal with a username.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o)
Compares the specified Object with this
CassPrincipal
for equality. |
java.lang.String |
getName()
Return the username for this
CassPrincipal . |
int |
hashCode()
Return a hash code for this
CassPrincipal . |
java.lang.String |
toString()
Return a string representation of this
CassPrincipal . |
public CassandraPrincipal(java.lang.String name)
name
- the username for this user.java.lang.NullPointerException
- if the name
is null
.public java.lang.String getName()
CassPrincipal
.
getName
in interface java.security.Principal
CassPrincipal
public java.lang.String toString()
CassPrincipal
.
toString
in interface java.security.Principal
toString
in class java.lang.Object
CassPrincipal
.public boolean equals(java.lang.Object o)
CassPrincipal
for equality. Returns true if the given object is also a
CassPrincipal
and the two CassPrincipals
have the same username.
equals
in interface java.security.Principal
equals
in class java.lang.Object
o
- Object to be compared for equality with this
CassPrincipal
.CassPrincipal
.public int hashCode()
CassPrincipal
.
hashCode
in interface java.security.Principal
hashCode
in class java.lang.Object
CassPrincipal
.Copyright © 2019 The Apache Software Foundation