ISnowflake
public class AuditLogEntry extends java.lang.Object implements ISnowflake
AuditLogPaginationAction
.
Guild
audit-logs.Constructor | Description |
---|---|
AuditLogEntry(ActionType type,
long id,
long targetId,
net.dv8tion.jda.core.entities.impl.GuildImpl guild,
net.dv8tion.jda.core.entities.impl.UserImpl user,
net.dv8tion.jda.core.entities.impl.WebhookImpl webhook,
java.lang.String reason,
java.util.Map<java.lang.String,AuditLogChange> changes,
java.util.Map<java.lang.String,java.lang.Object> options) |
Modifier and Type | Method | Description |
---|---|---|
boolean |
equals(java.lang.Object obj) |
|
AuditLogChange |
getChangeByKey(java.lang.String key) |
Shortcut to
lookup!
This lookup is case-insensitive! |
AuditLogChange |
getChangeByKey(AuditLogKey key) |
Shortcut to
lookup!
This lookup is case-insensitive! |
java.util.Map<java.lang.String,AuditLogChange> |
getChanges() |
Key-Value
Map containing all AuditLogChanges made in this entry. |
java.util.List<AuditLogChange> |
getChangesForKeys(AuditLogKey... keys) |
Filters all changes by the specified keys
|
Guild |
getGuild() |
The
Guild this audit-log entry refers to |
long |
getIdLong() |
The Snowflake id of this entity.
|
JDA |
getJDA() |
The corresponding JDA instance of the referring Guild
|
<T> T |
getOption(AuditLogOption option) |
Shortcut to
lookup! |
<T> T |
getOptionByName(java.lang.String name) |
Shortcut to
lookup!
This lookup is case-insensitive! |
java.util.Map<java.lang.String,java.lang.Object> |
getOptions() |
Key-Value
Map containing all Options made in this entry. |
java.util.List<java.lang.Object> |
getOptions(AuditLogOption... options) |
Constructs a filtered, immutable list of options corresponding to
the provided
AuditLogOptions . |
java.lang.String |
getReason() |
The optional reason why this action was executed.
|
java.lang.String |
getTargetId() |
The id for the target entity.
|
long |
getTargetIdLong() |
The id for the target entity.
|
TargetType |
getTargetType() |
The
TargetType defining what kind of
entity was targeted by this action. |
ActionType |
getType() |
The
ActionType defining what auditable
Action is referred to by this entry. |
User |
getUser() |
The
User responsible
for this action. |
Webhook |
getWebhook() |
The
Webhook that the target id of this audit-log entry refers to |
int |
hashCode() |
|
java.lang.String |
toString() |
getCreationTime, getId
public AuditLogEntry(ActionType type, long id, long targetId, net.dv8tion.jda.core.entities.impl.GuildImpl guild, net.dv8tion.jda.core.entities.impl.UserImpl user, net.dv8tion.jda.core.entities.impl.WebhookImpl webhook, java.lang.String reason, java.util.Map<java.lang.String,AuditLogChange> changes, java.util.Map<java.lang.String,java.lang.Object> options)
public long getIdLong()
ISnowflake
getIdLong
in interface ISnowflake
public long getTargetIdLong()
TargetType
which is specified by getTargetType()
!public java.lang.String getTargetId()
TargetType
which is specified by getTargetType()
!@Nullable public Webhook getWebhook()
Webhook
that the target id of this audit-log entry refers topublic Guild getGuild()
Guild
this audit-log entry refers to@Nullable public User getUser()
User
responsible
for this action.@Nullable public java.lang.String getReason()
public JDA getJDA()
public java.util.Map<java.lang.String,AuditLogChange> getChanges()
Map
containing all AuditLogChanges
made in this entry.
The keys for the returned map are case-insensitive keys defined in the regarding AuditLogChange value.
Map.values()
!@Nullable public AuditLogChange getChangeByKey(AuditLogKey key)
getChanges()
.get(key)
lookup!
key
- The AuditLogKey
to look for@Nullable public AuditLogChange getChangeByKey(java.lang.String key)
getChanges()
.get(key)
lookup!
key
- The key to look forpublic java.util.List<AuditLogChange> getChangesForKeys(AuditLogKey... keys)
keys
- Varargs AuditLogKeys
to look forAuditLogChanges
java.lang.IllegalArgumentException
- If provided with null arraypublic java.util.Map<java.lang.String,java.lang.Object> getOptions()
Map
containing all Options made in this entry. The keys for the returned map are
case-insensitive keys defined in the regarding AuditLogChange value.
Map.values()
!
Options may include secondary targets or details that do not qualify as "change".
An example of that would be the member
option
for CHANNEL_OVERRIDE_UPDATE
containing the user_id of a Member
.
@Nullable public <T> T getOptionByName(java.lang.String name)
getOptions()
.get(name)
lookup!
T
- The expected type for this option name
- The field name to look forjava.lang.ClassCastException
- If the type-cast failed for the generic type.@Nullable public <T> T getOption(AuditLogOption option)
getOptions()
.get(name)
lookup!T
- The expected type for this option option
- The AuditLogOption
java.lang.ClassCastException
- If the type-cast failed for the generic type.java.lang.IllegalArgumentException
- If provided with null
option.public java.util.List<java.lang.Object> getOptions(AuditLogOption... options)
AuditLogOptions
.
null
values!options
- The not-null AuditLogOptions
which will be used to gather option values via getOption(AuditLogOption)
!java.lang.IllegalArgumentException
- If provided with null optionspublic ActionType getType()
ActionType
defining what auditable
Action is referred to by this entry.ActionType
public TargetType getTargetType()
TargetType
defining what kind of
entity was targeted by this action.
getType().getTargetType()
TargetType
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object