Package 

Class CustomPrincipal


  • @ControllerAdvice() 
    public final class CustomPrincipal
    
                        

    This is a class that can do conversions on parameters that get autowired into controllers.

    • Method Summary

      Modifier and Type Method Description
      final User getPrincipal(Principal principal) This Model Attribute casts the Principal that Spring autowires into our custom User class - the properties are the same, but the ID is a UUID instead of a string
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CustomPrincipal

        CustomPrincipal()
    • Method Detail

      • getPrincipal

        @ModelAttribute() final User getPrincipal(Principal principal)

        This Model Attribute casts the Principal that Spring autowires into our custom User class - the properties are the same, but the ID is a UUID instead of a string