Package discord4j.core.object
Class ExtendedInvite
- java.lang.Object
-
- discord4j.core.object.Invite
-
- discord4j.core.object.ExtendedInvite
-
- All Implemented Interfaces:
DiscordObject
public final class ExtendedInvite extends Invite
Metadata for a Discord invite.- See Also:
- Metadata Object
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class discord4j.core.object.Invite
Invite.Type
-
-
Constructor Summary
Constructors Constructor Description ExtendedInvite(GatewayDiscordClient gateway, discord4j.discordjson.json.InviteData data)
Constructs aExtendedInvite
with an associatedGatewayDiscordClient
and Discord data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Instant
getCreation()
Gets when this invite was created.Optional<Instant>
getExpiration()
Gets the instant this invite expires, if possible.int
getMaxUses()
Gets the max number of times this invite can be used.int
getUses()
Gets the number of times this invite has been used.boolean
isTemporary()
Gets whether this invite only grants temporary membership.String
toString()
-
Methods inherited from class discord4j.core.object.Invite
delete, delete, getApproximateMemberCount, getApproximatePresenceCount, getChannel, getChannel, getChannelId, getClient, getCode, getGuild, getGuild, getGuildId, getInviter, getInviterId, getTargetType, getTargetUser, getTargetUserId, getTargetUserType
-
-
-
-
Constructor Detail
-
ExtendedInvite
public ExtendedInvite(GatewayDiscordClient gateway, discord4j.discordjson.json.InviteData data)
Constructs aExtendedInvite
with an associatedGatewayDiscordClient
and Discord data.- Parameters:
gateway
- TheGatewayDiscordClient
associated to this object, must be non-null.data
- The raw data as represented by Discord, must be non-null.
-
-
Method Detail
-
getUses
public int getUses()
Gets the number of times this invite has been used.- Returns:
- The number of times this invite has been used.
-
getMaxUses
public int getMaxUses()
Gets the max number of times this invite can be used.- Returns:
- The max number of times this invite can be used.
-
getExpiration
public Optional<Instant> getExpiration()
Gets the instant this invite expires, if possible.- Returns:
- The instant this invite expires, if empty, invite is never expiring.
-
isTemporary
public boolean isTemporary()
Gets whether this invite only grants temporary membership.- Returns:
true
if this invite only grants temporary membership
-
getCreation
public Instant getCreation()
Gets when this invite was created.- Returns:
- When this invite was created.
-
-