PHP Class AppserverIo\Appserver\ServletEngine\Security\SimplePrincipal

Inheritance: implements AppserverIo\Psr\Security\PrincipalInterface
Show file Open project: appserver-io/appserver Class Usage Examples

Public Methods

Method Description
__construct ( string $name ) Initialize the principal with the passed name.
__toString ( ) : string Returns the principals name as string.
equals ( AppserverIo\Psr\Security\PrincipalInterface $another ) : boolean Compare this SimplePrincipal's name against another Principal.
getName ( ) : AppserverIo\Lang\String Return's the principals name as String.

Method Details

__construct() public method

Initialize the principal with the passed name.
public __construct ( string $name )
$name string The principal's name

__toString() public method

Returns the principals name as string.
public __toString ( ) : string
return string The principal's name

equals() public method

Compare this SimplePrincipal's name against another Principal.
public equals ( AppserverIo\Psr\Security\PrincipalInterface $another ) : boolean
$another AppserverIo\Psr\Security\PrincipalInterface The other principal to compare to
return boolean TRUE if name equals $another->getName();

getName() public method

Return's the principals name as String.
public getName ( ) : AppserverIo\Lang\String
return AppserverIo\Lang\String The principal's name