Class SimpleUser.Base<T>

java.lang.Object
com.mastfrog.acteur.auth.SimpleUser.Base<T>
Type Parameters:
T - The ID type
All Implemented Interfaces:
SimpleUser<T>
Enclosing interface:
SimpleUser<IdType>

public static class SimpleUser.Base<T> extends Object implements SimpleUser<T>
Simple implementation of SimpleUser
  • Nested Class Summary

    Nested classes/interfaces inherited from interface com.mastfrog.acteur.auth.SimpleUser

    SimpleUser.Base<T>
  • Constructor Summary

    Constructors
    Constructor
    Description
    Base(String name, int version, T id)
     
    Base(String name, int version, T id, String displayName)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final String
    Get a human-readable display name, falling back to the name if none is set
    final boolean
     
    final int
     
    final T
    id()
    An ID type, typically a database primary key or something like MongoDB's ObjectID
    Get a string representation of the ID suitable for use in URLs or other places
    final String
    Programmatic name of this user suitable for use in urls
     
    final int
    Version of this user, to be incremented when the record of this user is modified

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Base

      public Base(String name, int version, T id)
    • Base

      public Base(String name, int version, T id, String displayName)
  • Method Details

    • name

      public final String name()
      Description copied from interface: SimpleUser
      Programmatic name of this user suitable for use in urls
      Specified by:
      name in interface SimpleUser<T>
      Returns:
      A name
    • version

      public final int version()
      Description copied from interface: SimpleUser
      Version of this user, to be incremented when the record of this user is modified
      Specified by:
      version in interface SimpleUser<T>
      Returns:
      a version
    • id

      public final T id()
      Description copied from interface: SimpleUser
      An ID type, typically a database primary key or something like MongoDB's ObjectID
      Specified by:
      id in interface SimpleUser<T>
      Returns:
      The id that uniquely identifies this user
    • idAsString

      public String idAsString()
      Description copied from interface: SimpleUser
      Get a string representation of the ID suitable for use in URLs or other places
      Specified by:
      idAsString in interface SimpleUser<T>
      Returns:
      The string form of the id
    • displayName

      public final String displayName()
      Description copied from interface: SimpleUser
      Get a human-readable display name, falling back to the name if none is set
      Specified by:
      displayName in interface SimpleUser<T>
      Returns:
      A human readable name
    • equals

      public final boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object