Record Class User

java.lang.Object
java.lang.Record
fr.tiogars.domaintemplate.domains.auth.user.entities.User

public record User(@NotNull Long id, @NotNull String username, boolean enabled, @NotNull List<Role> roles, @NotNull Instant createdDate, @NotNull Instant lastModifiedDate) extends Record
Public user account representation.
  • Constructor Summary

    Constructors
    Constructor
    Description
    User(@NotNull Long id, @NotNull String username, boolean enabled, @NotNull List<Role> roles, @NotNull Instant createdDate, @NotNull Instant lastModifiedDate)
    Creates an instance of a User record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull Instant
    Returns the value of the createdDate record component.
    boolean
    Returns the value of the enabled record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    @NotNull Long
    id()
    Returns the value of the id record component.
    @NotNull Instant
    Returns the value of the lastModifiedDate record component.
    @NotNull List<Role>
    Returns the value of the roles record component.
    final String
    Returns a string representation of this record class.
    @NotNull String
    Returns the value of the username record component.

    Methods inherited from class Object

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

    • User

      public User(@NotNull @NotNull Long id, @NotNull @NotNull String username, boolean enabled, @NotNull @NotNull List<Role> roles, @NotNull @NotNull Instant createdDate, @NotNull @NotNull Instant lastModifiedDate)
      Creates an instance of a User record class.
      Parameters:
      id - the value for the id record component
      username - the value for the username record component
      enabled - the value for the enabled record component
      roles - the value for the roles record component
      createdDate - the value for the createdDate record component
      lastModifiedDate - the value for the lastModifiedDate record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • id

      @NotNull public @NotNull Long id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • username

      @NotNull public @NotNull String username()
      Returns the value of the username record component.
      Returns:
      the value of the username record component
    • enabled

      public boolean enabled()
      Returns the value of the enabled record component.
      Returns:
      the value of the enabled record component
    • roles

      @NotNull public @NotNull List<Role> roles()
      Returns the value of the roles record component.
      Returns:
      the value of the roles record component
    • createdDate

      @NotNull public @NotNull Instant createdDate()
      Returns the value of the createdDate record component.
      Returns:
      the value of the createdDate record component
    • lastModifiedDate

      @NotNull public @NotNull Instant lastModifiedDate()
      Returns the value of the lastModifiedDate record component.
      Returns:
      the value of the lastModifiedDate record component