T
- the type of the object containing the changed fieldE
- the type of the changed list's elementspublic class ListFieldReplace<T,E> extends ListFieldChange<T>
@OnChange
-annotated methods
when an element is replaced in a list field.Constructor and Description |
---|
ListFieldReplace(T jobj,
int storageId,
String fieldName,
int index,
E oldValue,
E newValue)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
apply(JTransaction jtx,
JObject jobj)
Apply this change to the given object in the given transaction.
|
boolean |
equals(Object obj) |
int |
getIndex()
Get the list index at which the element was replaced.
|
E |
getNewValue()
Get the value of the field after the change.
|
E |
getOldValue()
Get the value of the field before the change.
|
int |
hashCode() |
String |
toString() |
<R> R |
visit(ChangeSwitch<R> target)
Apply visitor pattern.
|
getFieldName, getStorageId
public ListFieldReplace(T jobj, int storageId, String fieldName, int index, E oldValue, E newValue)
jobj
- Java object containing the list field that changedstorageId
- the storage ID of the affected fieldfieldName
- the name of the field that changedindex
- the index at which the replacement occurredoldValue
- the old value in the listnewValue
- the new value in the listIllegalArgumentException
- if jobj
or fieldName
is nullpublic <R> R visit(ChangeSwitch<R> target)
Change
target
corresponding to this instance's type.public void apply(JTransaction jtx, JObject jobj)
Change
public int getIndex()
public E getOldValue()
public E getNewValue()
public boolean equals(Object obj)
equals
in class FieldChange<T>
public int hashCode()
hashCode
in class FieldChange<T>
Copyright © 2022. All rights reserved.