edu.stanford.rt.credential
Class Role

java.lang.Object
  |
  +--edu.stanford.rt.credential.Role
All Implemented Interfaces:
PrincipalExpression, java.io.Serializable

public class Role
extends java.lang.Object
implements PrincipalExpression

Author:
Ninghui Li, Sandra Qiu
Implementation of Role object in RTML. A role consists of 2 parts: a principal and a role term.
See Also:
Serialized Form

Field Summary
private  Principal principal
           
private  RoleTerm roleTerm
           
 
Constructor Summary
Role(Principal principal, RoleTerm roleTerm)
          Constructor for Role.
 
Method Summary
 boolean equals(java.lang.Object o)
          Two roles are equal if both their principals are equal and the role names are equal.
 java.lang.String getName()
          Method getName.
 Principal getPrincipal()
          Returns the principal.
 RoleDeclaration getRoleDeclaration()
          Method getRoleDeclaration.
 RoleTerm getRoleTerm()
          Returns the roleTerm.
 int hashCode()
           
 java.lang.String toString(java.lang.String indent)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

principal

private Principal principal

roleTerm

private RoleTerm roleTerm
Constructor Detail

Role

public Role(Principal principal,
            RoleTerm roleTerm)
Constructor for Role.

Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Two roles are equal if both their principals are equal and the role names are equal.

Overrides:
equals in class java.lang.Object

getPrincipal

public Principal getPrincipal()
Returns the principal.

Returns:
Principal

getRoleTerm

public RoleTerm getRoleTerm()
Returns the roleTerm.

Returns:
RoleTerm

getRoleDeclaration

public RoleDeclaration getRoleDeclaration()
Method getRoleDeclaration.

Returns:
RoleDeclaration The corresponding role declaration.

getName

public java.lang.String getName()
Method getName.

Returns:
String The role name.

toString

public java.lang.String toString(java.lang.String indent)
Specified by:
toString in interface PrincipalExpression