Interface MemberCacheView

    • Method Detail

      • getElementById

        @Nullable
        Member getElementById​(long id)
        Retrieves the member represented by the provided ID.
        Specified by:
        getElementById in interface SnowflakeCacheView<Member>
        Parameters:
        id - The ID of the member
        Returns:
        Possibly-null member for the specified ID
      • getElementById

        @Nullable
        default Member getElementById​(@Nonnull
                                      java.lang.String id)
        Retrieves the member represented by the provided ID.
        Specified by:
        getElementById in interface SnowflakeCacheView<Member>
        Parameters:
        id - The ID of the member
        Returns:
        Possibly-null member for the specified ID
        Throws:
        java.lang.NumberFormatException - If the provided String is null or cannot be resolved to an unsigned long id
      • getElementsByUsername

        @Nonnull
        java.util.List<Member> getElementsByUsername​(@Nonnull
                                                     java.lang.String name,
                                                     boolean ignoreCase)
        Creates an immutable list of all members matching the given username.
        This will check the name of the wrapped user.
        Parameters:
        name - The name to check
        ignoreCase - Whether to ignore case when comparing usernames
        Returns:
        Immutable list of members with the given username
        Throws:
        java.lang.IllegalArgumentException - If the provided name is null
      • getElementsByUsername

        @Nonnull
        default java.util.List<Member> getElementsByUsername​(@Nonnull
                                                             java.lang.String name)
        Creates an immutable list of all members matching the given username.
        This will check the name of the wrapped user.
        Parameters:
        name - The name to check
        Returns:
        Immutable list of members with the given username
        Throws:
        java.lang.IllegalArgumentException - If the provided name is null
      • getElementsByNickname

        @Nonnull
        java.util.List<Member> getElementsByNickname​(@Nullable
                                                     java.lang.String name,
                                                     boolean ignoreCase)
        Creates an immutable list of all members matching the given nickname.
        This will check the nickname of the member. If provided with null this will check for members that have no nickname set.
        Parameters:
        name - The nullable nickname to check
        ignoreCase - Whether to ignore case when comparing nicknames
        Returns:
        Immutable list of members with the given nickname
      • getElementsByNickname

        @Nonnull
        default java.util.List<Member> getElementsByNickname​(@Nullable
                                                             java.lang.String name)
        Creates an immutable list of all members matching the given nickname.
        This will check the nickname of the member. If provided with null this will check for members that have no nickname set.
        Parameters:
        name - The nullable nickname to check
        Returns:
        Immutable list of members with the given nickname
      • getElementsWithRoles

        @Nonnull
        java.util.List<Member> getElementsWithRoles​(@Nonnull
                                                    Role... roles)
        Creates an immutable list of all members that hold all of the provided roles.
        Parameters:
        roles - Roles the members should have
        Returns:
        Immutable list of members with the given roles
        Throws:
        java.lang.IllegalArgumentException - If provided with null
      • getElementsWithRoles

        @Nonnull
        java.util.List<Member> getElementsWithRoles​(@Nonnull
                                                    java.util.Collection<Role> roles)
        Creates an immutable list of all members that hold all of the provided roles.
        Parameters:
        roles - Roles the members should have
        Returns:
        Immutable list of members with the given roles
        Throws:
        java.lang.IllegalArgumentException - If provided with null