Package net.dv8tion.jda.api.audit
Class AuditLogChange
- java.lang.Object
-
- net.dv8tion.jda.api.audit.AuditLogChange
-
public class AuditLogChange extends 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(Object oldValue, Object newValue, String key)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
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()
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:
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:
ClassCastException
- If the type cast to the generic type fails
-
getKey
@Nonnull public String getKey()
The key which defines the field that was updated by this change- Returns:
- The key
-
-