Package net.dv8tion.jda.api.audit
Class AuditLogChange
- java.lang.Object
-
- net.dv8tion.jda.api.audit.AuditLogChange
-
public class AuditLogChange extends java.lang.ObjectPlain-Old-Java-Object (POJO) representing a single change for anAuditLogEntry!
This object holds theold-andnew valuefor 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 booleanequals(java.lang.Object obj)java.lang.StringgetKey()The key which defines the field that was updated by this change<T> TgetNewValue()The updated value for the field specified bygetKey().<T> TgetOldValue()The previous value for the field specified bygetKey().inthashCode()java.lang.StringtoString()
-
-
-
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:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-