Package org.infinispan.transaction.impl
Class ModificationList
- java.lang.Object
-
- org.infinispan.transaction.impl.ModificationList
-
public final class ModificationList extends Object
A list ofWriteCommand
for a transactionWriteCommand
can only be appended and the methodsgetAllModifications()
andgetModifications()
return a snapshot of the current list.WriteCommand
appended after those methods are invoked, are not visible.- Since:
- 14.0
-
-
Constructor Summary
Constructors Constructor Description ModificationList()
ModificationList(int capacity)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
append(org.infinispan.commands.write.WriteCommand command)
Appends theWriteCommand
to this list.void
freeze()
Freezes this list.static ModificationList
fromCollection(Collection<org.infinispan.commands.write.WriteCommand> mods)
List<org.infinispan.commands.write.WriteCommand>
getAllModifications()
List<org.infinispan.commands.write.WriteCommand>
getModifications()
Returns a snapshot of this list.boolean
hasNonLocalModifications()
boolean
isEmpty()
int
size()
String
toString()
-
-
-
Method Detail
-
fromCollection
public static ModificationList fromCollection(Collection<org.infinispan.commands.write.WriteCommand> mods)
-
append
public void append(org.infinispan.commands.write.WriteCommand command)
Appends theWriteCommand
to this list.- Parameters:
command
- TheWriteCommand
instance to append.- Throws:
IllegalStateException
- If this list is frozen.- See Also:
freeze()
-
freeze
public void freeze()
Freezes this list.After invoked, no more
WriteCommand
can be appended to this list.append(WriteCommand)
will throw aIllegalStateException
.
-
getModifications
public List<org.infinispan.commands.write.WriteCommand> getModifications()
Returns a snapshot of this list.This snapshot does not contain
WriteCommand
with flagFlag.CACHE_MODE_LOCAL
and it cannot be modified.- Returns:
- A snapshot of this list.
-
hasNonLocalModifications
public boolean hasNonLocalModifications()
- Returns:
true
if it contains one or moreWriteCommand
withoutFlag.CACHE_MODE_LOCAL
.
-
getAllModifications
public List<org.infinispan.commands.write.WriteCommand> getAllModifications()
- Returns:
- A snapshot of this list with all
WriteCommand
. TheList
cannot be modified. - See Also:
getModifications()
-
size
public int size()
- Returns:
- The number of
WriteCommand
stored this list.
-
isEmpty
public boolean isEmpty()
- Returns:
true
if this list is empty.
-
-