Interface UserIdentity

All Known Subinterfaces:
CommunicationMessage, Request, Response
All Known Implementing Classes:
AbstractCommunicationMessage, BroadcastUserMessage, ExternalMessage, ExternalRequestMessage, RequestMessage, ResponseMessage, SendMessage, UserRequestMessage, UserResponseMessage

public interface UserIdentity
Contract for messages that carry user identity and authentication state.

Provides accessors for the user id and a verification flag, along with convenience methods for copying identity between messages and binding an authenticated user.

Since:
25.1
Author:
渔民小镇
date:
2025-09-17
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    bindingUserId(long userId)
    Bind the given user id and mark the identity as verified.
    long
    Get the user id.
    boolean
    Check whether the user's identity has been verified (authenticated).
    void
    setUserId(long userId)
    Set the user id.
    default void
    Copy the user id and verification flag from the given identity.
    void
    setVerifyIdentity(boolean verifyIdentity)
    Set the identity verification flag.
    default byte
    Return the verification state as a byte (1 for verified, 0 for unverified).
  • Method Details

    • getUserId

      long getUserId()
      Get the user id.
      Returns:
      the user id
    • setUserId

      void setUserId(long userId)
      Set the user id.
      Parameters:
      userId - the user id
    • isVerifyIdentity

      boolean isVerifyIdentity()
      Check whether the user's identity has been verified (authenticated).
      Returns:
      true if the identity is verified
    • setVerifyIdentity

      void setVerifyIdentity(boolean verifyIdentity)
      Set the identity verification flag.
      Parameters:
      verifyIdentity - true if the identity is verified
    • verifyIdentity

      default byte verifyIdentity()
      Return the verification state as a byte (1 for verified, 0 for unverified).
      Returns:
      1 if verified, 0 otherwise
    • setUserIdentity

      default void setUserIdentity(UserIdentity userIdentity)
      Copy the user id and verification flag from the given identity.
      Parameters:
      userIdentity - the source identity to copy from
    • bindingUserId

      default void bindingUserId(long userId)
      Bind the given user id and mark the identity as verified.
      Parameters:
      userId - the user id to bind