Class ActorCreatedByAdminDTO

java.lang.Object
de.gustavblass.fsu.fmi.roombooking.dto.ActorCreatedByAdminDTO
Direct Known Subclasses:
LocalActorCreatedByAdminDTO

public abstract class ActorCreatedByAdminDTO extends Object
A data-transfer object that represents and validates the HTML form input POSTed to ActorAdminController.createActor(LocalActorCreatedByAdminDTO, BindingResult, HttpServletResponse).
Implementation Note:
This is a class and not a record, because only a class allows enabled to be set to true by default (for the end-user's convenience when filling in the HTML form) while remaining mutable.
  • Field Details

    • USER_NAME_PATTERN

      @NonNull public static final @NonNull String USER_NAME_PATTERN
      The regular expression that defines how the userName must be formatted.
      See Also:
    • USER_NAME_MINIMUM_LENGTH

      public static final int USER_NAME_MINIMUM_LENGTH
      The userName must contain at least this number of characters.
      See Also:
    • USER_NAME_MAXIMUM_LENGTH

      public static final int USER_NAME_MAXIMUM_LENGTH
      The userName must not contain more than this number of characters.
      See Also:
    • NAME_PATTERN

      @NonNull public static final @NonNull String NAME_PATTERN
      The regular expression that defines how the name must be formatted.
      See Also:
    • MINIMUM_NAME_LENGTH

      public static final int MINIMUM_NAME_LENGTH
      The name must contain at least this number of characters.
      See Also:
    • role

      @NotNull private @NotNull ActorRole role
      The role that the future Actor shall have.
    • userName

      @NotNull @NotBlank @Length(min=3, max=32) @Pattern(regexp="^[a-zA-Z0-9][a-z0-9.\\-_]+[a-zA-Z0-9]$") private @NotNull @NotBlank @Length(min=3,max=32) @Pattern(regexp="^[a-zA-Z0-9][a-z0-9.\\-_]+[a-zA-Z0-9]$") String userName
      The Actor's userName used for log-in. If the Pattern is changed, the corresponding i18n key (Pattern.userName) and the HTML pattern attribute in the corresponding forms must be updated as well.
    • name

      @NotNull @NotBlank @Length(min=2) @Pattern(regexp="^[\\p{L}'\u2019.,\\-_\\s+]+$") private @NotNull @NotBlank @Length(min=2) @Pattern(regexp="^[\\p{L}'\u2019.,\\-_\\s+]+$") String name
      The Actor's real name as printed on their University ID card or government ID. If the Pattern is changed, the corresponding i18n key (Pattern.name) must be updated as well.
    • eMailAddress

      @NotNull @Email private @NotNull @Email String eMailAddress
      The e-mail address of the future Actor.
    • enabled

      private Boolean enabled
      Whether to enable the future Actor's account.
    • locked

      private Boolean locked
      Whether to lock the future Actor's account.
  • Constructor Details

    • ActorCreatedByAdminDTO

      public ActorCreatedByAdminDTO()
  • Method Details

    • clear

      public void clear()
      Deletes all personal data from this object by setting all fields to null.
    • clearCredentials

      public abstract void clearCredentials()
      Sets any passwords or other authentication secrets to null.