Package discord4j.core.object.entity
Class ApplicationInfo
- java.lang.Object
-
- discord4j.core.object.entity.ApplicationInfo
-
- All Implemented Interfaces:
DiscordObject
,Entity
public final class ApplicationInfo extends Object implements Entity
Represents the Current (typically) Application Information.- See Also:
- Application Resource
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ApplicationInfo.Flag
Describes the flags of an application.
-
Constructor Summary
Constructors Constructor Description ApplicationInfo(GatewayDiscordClient gateway, discord4j.discordjson.json.ApplicationInfoData data)
Constructs aApplicationInfo
with an associatedGatewayDiscordClient
and Discord data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
GatewayDiscordClient
getClient()
Returns theGatewayDiscordClient
that created this object.discord4j.discordjson.json.ApplicationInfoData
getData()
Gets the data of the app.String
getDescription()
Gets the description of the app.EnumSet<ApplicationInfo.Flag>
getFlags()
Returns the public flags of thisApplicationInfo
.Mono<Image>
getIcon(Image.Format format)
Gets the icon of the application.Optional<String>
getIconUrl(Image.Format format)
Gets the icon URL of the application, if present.Snowflake
getId()
Gets the Snowflake that uniquely identifies this entity.String
getName()
Gets the name of the app.Mono<User>
getOwner()
Requests to retrieve the owner of the application.Mono<User>
getOwner(EntityRetrievalStrategy retrievalStrategy)
Requests to retrieve the owner of the application, using the given retrieval strategy.Snowflake
getOwnerId()
Gets the ID of the owner of the application.Optional<String>
getPrivacyPolicyUrl()
Gets the url of the app's privacy policy, if present.Optional<ApplicationTeam>
getTeam()
Gets the members of the application team, if the application belongs to a team.Optional<String>
getTermsOfServiceUrl()
Gets the url of the app's terms of service, if present.int
hashCode()
boolean
isPublic()
Gets whether only the app owner can join the app's bot to guilds.boolean
requireCodeGrant()
Gets whether the app's bot will only join upon completion of the full OAuth2 code grant flow.String
toString()
-
-
-
Constructor Detail
-
ApplicationInfo
public ApplicationInfo(GatewayDiscordClient gateway, discord4j.discordjson.json.ApplicationInfoData data)
Constructs aApplicationInfo
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
-
getClient
public GatewayDiscordClient getClient()
Description copied from interface:DiscordObject
Returns theGatewayDiscordClient
that created this object. Methods in it are exclusively based on the entity cache orStore
in use. Refer to callinggetClient().rest()
to access aDiscordClient
that is capable of requesting entities directly from the REST API.- Specified by:
getClient
in interfaceDiscordObject
- Returns:
- The
GatewayDiscordClient
associated to this object.
-
getId
public Snowflake getId()
Description copied from interface:Entity
Gets the Snowflake that uniquely identifies this entity.
-
getData
public discord4j.discordjson.json.ApplicationInfoData getData()
Gets the data of the app.- Returns:
- The data of the app.
-
getName
public String getName()
Gets the name of the app.- Returns:
- The name of the app.
-
getIconUrl
public Optional<String> getIconUrl(Image.Format format)
Gets the icon URL of the application, if present.- Parameters:
format
- The format for the URL.- Returns:
- The icon URL of the application, if present.
-
getIcon
public Mono<Image> getIcon(Image.Format format)
Gets the icon of the application.
-
getDescription
public String getDescription()
Gets the description of the app.- Returns:
- The description of the app.
-
isPublic
public boolean isPublic()
Gets whether only the app owner can join the app's bot to guilds.- Returns:
true
if only the app owner can join the app's bot to guilds,false
otherwise.
-
requireCodeGrant
public boolean requireCodeGrant()
Gets whether the app's bot will only join upon completion of the full OAuth2 code grant flow.- Returns:
true
if the app's bot will only join upon completion of the full OAuth2 code grant flow,false
otherwise.
-
getTermsOfServiceUrl
public Optional<String> getTermsOfServiceUrl()
Gets the url of the app's terms of service, if present.- Returns:
- The url of the app's terms of service, if present.
-
getPrivacyPolicyUrl
public Optional<String> getPrivacyPolicyUrl()
Gets the url of the app's privacy policy, if present.- Returns:
- The url of the app's privacy policy, if present.
-
getOwnerId
public Snowflake getOwnerId()
Gets the ID of the owner of the application.- Returns:
- The ID of the owner of the application.
-
getOwner
public Mono<User> getOwner(EntityRetrievalStrategy retrievalStrategy)
Requests to retrieve the owner of the application, using the given retrieval strategy.
-
getTeam
public Optional<ApplicationTeam> getTeam()
Gets the members of the application team, if the application belongs to a team.- Returns:
- The members of the application's team, if the application belongs to a team.
-
getFlags
public EnumSet<ApplicationInfo.Flag> getFlags()
Returns the public flags of thisApplicationInfo
.- Returns:
- A
EnumSet
with the public flags of this application.
-
-