public final class NumericPrincipal extends Object implements Principal, Serializable
Constructor and Description |
---|
NumericPrincipal(long id)
Construct a new instance.
|
NumericPrincipal(String id)
Construct a new instance from a decimal string.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(NumericPrincipal obj)
Determine whether this principal is equal to the given object.
|
boolean |
equals(Object obj)
Determine whether this principal is equal to the given object.
|
long |
getId()
Get the ID of the principal.
|
String |
getName()
Returns the name of this principal, which is just the string representation of the ID.
|
int |
hashCode()
Get the hash code of this principal.
|
String |
toString()
Get this principal as a string.
|
public NumericPrincipal(long id)
id
- the ID of the principalpublic NumericPrincipal(String id) throws NumberFormatException
id
- the ID of the principal, as a stringNumberFormatException
- if the number is not a valid non-negative long integerpublic long getId()
public boolean equals(Object obj)
public boolean equals(NumericPrincipal obj)
obj
- the objecttrue
if they are equal, false
otherwisepublic int hashCode()
public String toString()
Copyright © 2020 JBoss by Red Hat. All rights reserved.