Class ModificationList


  • public final class ModificationList
    extends Object
    A list of WriteCommand for a transaction

    WriteCommand can only be appended and the methods getAllModifications() and getModifications() return a snapshot of the current list. WriteCommand appended after those methods are invoked, are not visible.

    Since:
    14.0
    • Constructor Detail

      • ModificationList

        public ModificationList()
      • ModificationList

        public ModificationList​(int capacity)
    • Method Detail

      • append

        public void append​(org.infinispan.commands.write.WriteCommand command)
        Appends the WriteCommand to this list.
        Parameters:
        command - The WriteCommand instance to append.
        Throws:
        IllegalStateException - If this list is frozen.
        See Also:
        freeze()
      • getModifications

        public List<org.infinispan.commands.write.WriteCommand> getModifications()
        Returns a snapshot of this list.

        This snapshot does not contain WriteCommand with flag Flag.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 more WriteCommand without Flag.CACHE_MODE_LOCAL.
      • getAllModifications

        public List<org.infinispan.commands.write.WriteCommand> getAllModifications()
        Returns:
        A snapshot of this list with all WriteCommand. The List 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.