Package net.dv8tion.jda.api.audit
Class AuditLogChange
- java.lang.Object
-
- net.dv8tion.jda.api.audit.AuditLogChange
-
public class AuditLogChange extends java.lang.Object
Plain-Old-Java-Object (POJO) representing a single change for anAuditLogEntry
!
This object holds theold-
andnew value
for the updated field. The field is specified by thekey
.
-
-
Constructor Summary
Constructors Constructor Description AuditLogChange(java.lang.Object oldValue, java.lang.Object newValue, java.lang.String key)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
java.lang.String
getKey()
The key which defines the field that was updated by this change<T> T
getNewValue()
The updated value for the field specified bygetKey()
.<T> T
getOldValue()
The previous value for the field specified bygetKey()
.int
hashCode()
java.lang.String
toString()
-
-
-
Method Detail
-
getOldValue
@Nullable public <T> T getOldValue()
The previous value for the field specified bygetKey()
.- Type Parameters:
T
- The expected generic type for this value.
This will be used to cast the value.- Returns:
- The old value
- Throws:
java.lang.ClassCastException
- If the type cast to the generic type fails
-
getNewValue
@Nullable public <T> T getNewValue()
The updated value for the field specified bygetKey()
.- Type Parameters:
T
- The expected generic type for this value.
This will be used to cast the value.- Returns:
- The new value
- Throws:
java.lang.ClassCastException
- If the type cast to the generic type fails
-
getKey
@Nonnull public java.lang.String getKey()
The key which defines the field that was updated by this change- Returns:
- The key
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-