Interface Principal
- All Superinterfaces:
Serializable
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Generic concept of an authenticated thing. Examples include a person or a
service.
The implementation SimplePrincipal just contains the Id property. More complex Principal objects may contain additional information that are meaningful to the View layer but are generally transparent to the rest of CAS.
- Since:
- 3.0.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleancontainsAttribute(String name) Contains attribute by name.Principal attributes.getId()Principal id.default ObjectGets single valued attribute.default <T> TgetSingleValuedAttribute(String name, Class<T> expectedType) Gets attribute.
-
Method Details
-
getId
String getId()Principal id.- Returns:
- the unique id for the Principal
-
getAttributes
Principal attributes.- Returns:
- the map of configured attributes for this principal
-
getSingleValuedAttribute
Gets attribute.- Type Parameters:
T- the type parameter- Parameters:
name- the nameexpectedType- the expected type- Returns:
- the attribute
-
getSingleValuedAttribute
Gets single valued attribute.- Parameters:
name- the name- Returns:
- the single valued attribute
-
containsAttribute
Contains attribute by name.- Parameters:
name- the name- Returns:
- the boolean
-