Class MemberImpl

java.lang.Object
com.mewna.catnip.entity.impl.guild.MemberImpl
All Implemented Interfaces:
Entity, Member, GuildEntity, HasGuild, HasJoinedAt, Mentionable, Permissable, Snowflake, Timestamped, RequiresCatnip

public class MemberImpl extends Object implements Member, RequiresCatnip, Timestamped
Since:
9/1/18.
Author:
amy
  • Constructor Details

    • MemberImpl

      public MemberImpl()
    • MemberImpl

      public MemberImpl(Catnip catnip, long idAsLong, long guildIdAsLong, String nick, Set<String> roleIds, String joinedAt, String premiumSince, String avatarHash)
  • Method Details

    • joinedAt

      @Nonnull public OffsetDateTime joinedAt()
      Description copied from interface: Member
      When the user joined the server last.
      Members who have joined, left, then rejoined will only have the most recent join exposed.
      This may be null under some conditions, ex. a member leaving a guild. In cases like this, catnip will attempt to load the old data from the cache if possible, but it may not work, hence nullability.
      Specified by:
      joinedAt in interface HasJoinedAt
      Specified by:
      joinedAt in interface Member
      Returns:
      The date and time the member joined the guild.
    • premiumSince

      @Nullable public OffsetDateTime premiumSince()
      Description copied from interface: Member
      When the user last used their Nitro Boost on this guild.
      Members who have un-boosted a guild then re-boosted it will only have the most recent boost exposed.
      This will be null if the user is not currently boosting the guild.
      Specified by:
      premiumSince in interface Member
      Returns:
      The date and time when the member boosted the guild.
    • catnip

      public void catnip(@Nonnull Catnip catnip)
      Specified by:
      catnip in interface RequiresCatnip
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • builder

      public static MemberImpl.MemberImplBuilder builder()
    • catnip

      public Catnip catnip()
      Description copied from interface: Entity
      Returns the catnip instance associated with this entity.
      Specified by:
      catnip in interface Entity
      Returns:
      The catnip instance of this entity.
    • idAsLong

      public long idAsLong()
      Description copied from interface: Snowflake
      The ID of this snowflake, as a long.
      Specified by:
      idAsLong in interface Snowflake
      Returns:
      Long representing the ID.
    • guildIdAsLong

      public long guildIdAsLong()
      Description copied from interface: HasGuild
      The id of the guild this entity is from.
      Specified by:
      guildIdAsLong in interface HasGuild
      Returns:
      Long representing the guild ID.
    • nick

      public String nick()
      Description copied from interface: Member
      The user's nickname in this guild.
      Specified by:
      nick in interface Member
      Returns:
      User's nickname. Null if not set.
    • roleIds

      public Set<String> roleIds()
      Description copied from interface: Member
      The ids of the user's roles in this guild.
      Specified by:
      roleIds in interface Member
      Returns:
      A Set of the ids of the user's roles.
    • avatarHash

      public String avatarHash()
      Specified by:
      avatarHash in interface Member
      Returns:
      The hash of the user's per-guild avatar.
    • idAsLong

      public MemberImpl idAsLong(long idAsLong)
      Returns:
      this.
    • guildIdAsLong

      public MemberImpl guildIdAsLong(long guildIdAsLong)
      Returns:
      this.
    • nick

      public MemberImpl nick(String nick)
      Returns:
      this.
    • roleIds

      public MemberImpl roleIds(Set<String> roleIds)
      Returns:
      this.
    • joinedAt

      public MemberImpl joinedAt(String joinedAt)
      Returns:
      this.
    • premiumSince

      public MemberImpl premiumSince(String premiumSince)
      Returns:
      this.
    • avatarHash

      public MemberImpl avatarHash(String avatarHash)
      Returns:
      this.