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 aExtendedInvitewith an associatedGatewayDiscordClientand Discord data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InstantgetCreation()Gets when this invite was created.Optional<Instant>getExpiration()Gets the instant this invite expires, if possible.intgetMaxUses()Gets the max number of times this invite can be used.intgetUses()Gets the number of times this invite has been used.StringtoString()-
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 aExtendedInvitewith an associatedGatewayDiscordClientand Discord data.- Parameters:
gateway- TheGatewayDiscordClientassociated 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 possible.
-
getCreation
public Instant getCreation()
Gets when this invite was created.- Returns:
- When this invite was created.
-
-