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.

@FunctionalInterface public interface Principal extends Serializable
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 Details

    • getId

      String getId()
      Principal id.
      Returns:
      the unique id for the Principal
    • getAttributes

      default Map<String,List<Object>> getAttributes()
      Principal attributes.
      Returns:
      the map of configured attributes for this principal
    • getSingleValuedAttribute

      default <T> T getSingleValuedAttribute(String name, Class<T> expectedType)
      Gets attribute.
      Type Parameters:
      T - the type parameter
      Parameters:
      name - the name
      expectedType - the expected type
      Returns:
      the attribute
    • getSingleValuedAttribute

      default Object getSingleValuedAttribute(String name)
      Gets single valued attribute.
      Parameters:
      name - the name
      Returns:
      the single valued attribute
    • containsAttribute

      default boolean containsAttribute(String name)
      Contains attribute by name.
      Parameters:
      name - the name
      Returns:
      the boolean