Class User

    • Method Detail

      • getDisplayName

        public java.lang.String getDisplayName()
        Description copied from interface: User
        Gets this user's desired display name.
        Specified by:
        getDisplayName in interface User
        Returns:
        Display name.
      • getRegisteredDate

        public java.util.Date getRegisteredDate()
        Description copied from interface: User
        Gets the date this user was registered.
        Specified by:
        getRegisteredDate in interface User
        Returns:
        Register date.
      • getLastSeenDate

        public java.util.Date getLastSeenDate()
        Description copied from interface: User
        Gets the date this user was last seen.
        Specified by:
        getLastSeenDate in interface User
        Returns:
        Last seen date.
      • setLastSeenDate

        public void setLastSeenDate​(java.util.Date date)
        Description copied from interface: User
        Sets the last date this user was seen.
        Specified by:
        setLastSeenDate in interface User
        Parameters:
        date - last seen date.
      • getMembership

        public java.util.Collection<UserGroupMembership> getMembership()
        Description copied from interface: User
        Gets a collection of individual memberships, which is more definite than getUsers(), providing more specific information about membership.
        Specified by:
        getMembership in interface User
        Returns:
        immutable collection of user group membership records.
      • setDisplayName

        public void setDisplayName​(java.lang.String displayName)
                            throws java.lang.IllegalArgumentException
        Description copied from interface: User
        Sets this user's desired display name.
        Specified by:
        setDisplayName in interface User
        Parameters:
        displayName - Display name.
        Throws:
        java.lang.IllegalArgumentException
      • getUsername

        public java.lang.String getUsername()
        Description copied from interface: User
        Gets this user's username on the system.
        Specified by:
        getUsername in interface User
        Returns:
        Username.
      • getUserId

        public int getUserId()
      • setLastSeen

        public void setLastSeen​(int lastSeen)
      • getEntity

        public Entity getEntity()
        Description copied from interface: EntityType
        Gets the entity associated with this object.
        Specified by:
        getEntity in interface EntityType
        Returns:
        Associated entity.
      • getUserAssociation

        public UserAssociation getUserAssociation​(Platform platform,
                                                  java.lang.String id)
        Description copied from interface: User
        Gets a user association by platform and ID.
        Specified by:
        getUserAssociation in interface User
        Parameters:
        platform - Platform to search for
        id - ID to search for.
        Returns:
        UserAssociation instance if found, null otherwise.
      • getAssociations

        public java.util.Collection<UserAssociation> getAssociations()
        Description copied from interface: User
        Get a list of connections that associate this user with platforms.
        Specified by:
        getAssociations in interface User
        Returns:
        user associations.
      • getBans

        public java.util.Collection<UserBan> getBans()
        Description copied from interface: User
        Gets a list of all previous bans on record for this user.
        Specified by:
        getBans in interface User
        Returns:
        immutable collection of user ban history.
      • getIssuedBans

        public java.util.Collection<UserBan> getIssuedBans()
        Description copied from interface: User
        Gets a list of all previous bans issued by this user.
        Specified by:
        getIssuedBans in interface User
        Returns:
        immutable collection of user ban issuance history.
      • getBan

        public UserBan getBan()
        Description copied from interface: User
        Gets the current ban on record for the user.
        Specified by:
        getBan in interface User
        Returns:
        ban instance.
      • ban

        public UserBan ban​(java.lang.String reason,
                           java.util.Date date)
                    throws java.lang.SecurityException
        Description copied from interface: User
        Bans the user until the specified date
        Specified by:
        ban in interface User
        Parameters:
        reason - ban reason, may be null.
        date - date the ban should end.
        Returns:
        UserBan instance.
        Throws:
        java.lang.SecurityException - if there was a security violation creating the ban.
      • ban

        public UserBan ban​(java.lang.String reason)
                    throws java.lang.SecurityException
        Description copied from interface: User
        Bans the user until the specified date
        Specified by:
        ban in interface User
        Parameters:
        reason - ban reason, may be null.
        Returns:
        UserBan instance.
        Throws:
        java.lang.SecurityException - if there was a security violation creating the ban.
      • createAssociation

        public UserAssociation createAssociation​(Platform platform,
                                                 java.lang.String platformUserId)
        Description copied from interface: User
        Creates a user connection for this user.
        Specified by:
        createAssociation in interface User
        Parameters:
        platform - Platform to create the association on.
        platformUserId - Platform-specific ID to associate the connection to.
        Returns:
        UserAssociation instance.
      • removeAssociation

        public boolean removeAssociation​(Platform platform,
                                         java.lang.String platformUserId)
        Description copied from interface: User
        Removes a user association from this user.
        Specified by:
        removeAssociation in interface User
        Parameters:
        platform - Platform to remove an association for.
        platformUserId - Platform-specific id to remove an association for.
        Returns:
        true if the association was removed, false otherwise.
      • getType

        public UserType getType()
        Description copied from interface: User
        Gets the user's system type.
        Specified by:
        getType in interface User
        Returns:
        UserType instance.
      • setType

        public boolean setType​(UserType userType)
        Description copied from interface: User
        Changes the user's system type.
        Specified by:
        setType in interface User
        Parameters:
        userType - UserType instance to change to.
        Returns:
        true if the type was changed.
      • broadcastMessage

        public java.util.Collection<ChatMessage> broadcastMessage​(java.util.function.Function<ChatSender,​java.util.Collection<ChatMessage>> receiver)
        Description copied from interface: User
        Broadcasts the specified message receiver to the user.
        Specified by:
        broadcastMessage in interface User
        Parameters:
        receiver - ChatSender to broadcast, constructing messages for each broadcast endpoint for the user.
        Returns:
        collection of all broadcast messages.
      • getPrompt

        public io.manebot.database.model.User.Prompt getPrompt()
        Description copied from interface: User
        Gets the current user prompt.
        Specified by:
        getPrompt in interface User
        Returns:
        user prompt instance if one exists, null otherwise.
      • prompt

        public UserPrompt prompt​(java.util.function.Consumer<UserPrompt.Builder> consumer)
                          throws java.lang.IllegalStateException
        Description copied from interface: User
        Constructs and assigns a user prompt for this user. UserPrompts are completed on the thread of the user after they have been manually confirmed by the target user.
        Specified by:
        prompt in interface User
        Parameters:
        consumer - Consumer of a UserPrompt.Builder instance.
        Returns:
        constructed UserPrompt instance.
        Throws:
        java.lang.IllegalStateException - if there is a state issue constructing the prompt.
      • hasPermission

        public boolean hasPermission​(Permission permission,
                                     Grant fallback)
        Description copied from interface: EntityType
        Finds if this entity has a specific permission
        Specified by:
        hasPermission in interface EntityType
        Parameters:
        permission - Permission to check for.
        Returns:
        true if the permission is granted, false otherwise.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object