Package com.vaadin.collaborationengine
Class ListOperation
java.lang.Object
com.vaadin.collaborationengine.ListOperation
A list operation providing details such as the operation type, related
properties and conditions that should be met for the operation to succeed.
- Author:
- Vaadin Ltd
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ListOperationCreates a list operation to delete the value at the position specified by the given key.ifEmpty()Adds a condition that requires the list to be empty.Adds a condition that requires the specifiedkeyto be the first in the list.Adds a condition that requires the specifiedkeyto be the last in the list.Adds a condition that requires the specifiednextKeyto be right after the specifiedkeywhen the operation is applied.Adds a condition that requires the list not to be empty.Adds a condition that requires the specifiedprevKeyto be right before the specifiedkeywhen the operation is applied.Add a condition that requires the specifiedkeyto have the specifiedvalue.static ListOperationinsertAfter(ListKey after, Object value) Creates a list operation to insert the given value just after the position specified by the given key.static ListOperationinsertBefore(ListKey before, Object value) Creates a list operation to insert the given value just before the position specified by the given key.static ListOperationinsertBetween(ListKey prev, ListKey next, Object value) Creates a list operation to insert the given value between the positions specified by the given keys.static ListOperationinsertFirst(Object value) Creates a list operation to insert the given value as the first item of the list.static ListOperationinsertLast(Object value) Creates a list operation to insert the given value as the last item of the list.static ListOperationCreates a list operation to move the given entry to just after the position specified by the given key.static ListOperationmoveBefore(ListKey before, ListKey entry) Creates a list operation to move the given entry to just before the position specified by the given key.static ListOperationmoveBetween(ListKey prev, ListKey next, ListKey entry) Creates a list operation to move the given entry between the positions specified by the given keys.static ListOperationCreates a list operation to set the given value at the position specified by the given key.withScope(EntryScope scope) Sets the scope of the item affected by this operation.
-
Method Details
-
insertFirst
Creates a list operation to insert the given value as the first item of the list.- Parameters:
value- the value, notnull- Returns:
- the list operation, not
null
-
insertLast
Creates a list operation to insert the given value as the last item of the list.- Parameters:
value- the value, notnull- Returns:
- the list operation, not
null
-
insertBefore
Creates a list operation to insert the given value just before the position specified by the given key.- Parameters:
before- the position key, notnullvalue- the value, notnull- Returns:
- the list operation, not
null
-
insertAfter
Creates a list operation to insert the given value just after the position specified by the given key.- Parameters:
after- the position key, notnullvalue- the value, notnull- Returns:
- the list operation, not
null
-
insertBetween
Creates a list operation to insert the given value between the positions specified by the given keys. If the given keys are not adjacent, the operation will fail.- Parameters:
prev- the position of the previous item, notnullnext- the position of the next item, notnullvalue- the value, notnull- Returns:
- the list operation, not
null
-
moveBefore
Creates a list operation to move the given entry to just before the position specified by the given key.- Parameters:
before- the position key, notnullentry- the entry key to move, notnull- Returns:
- the list operation, not
null
-
moveAfter
Creates a list operation to move the given entry to just after the position specified by the given key.- Parameters:
after- the position key, notnullentry- the entry key to move, notnull- Returns:
- the list operation, not
null
-
moveBetween
Creates a list operation to move the given entry between the positions specified by the given keys. If the given keys are not adjacent, the operation will fail.- Parameters:
prev- the position of the previous item, notnullnext- the position of the next item, notnullentry- the entry key to move, notnull- Returns:
- the list operation, not
null
-
set
Creates a list operation to set the given value at the position specified by the given key. By default, the value will be set as topic scope.- Parameters:
key- the position key, notnullvalue- the value- Returns:
- the list operation, not
null
-
delete
Creates a list operation to delete the value at the position specified by the given key.- Parameters:
key- the position key, notnull- Returns:
- the list operation, not
null
-
withScope
Sets the scope of the item affected by this operation. If not set, the default scope will beEntryScope.TOPIC. Values withEntryScope.CONNECTIONscope will be automatically removed once the connection to the topic which created them is deactivated.- Parameters:
scope- the scope, notnull- Returns:
- this operation, not
null
-
ifNext
Adds a condition that requires the specifiednextKeyto be right after the specifiedkeywhen the operation is applied. AnullnextKeycan be used to represent the tail of the list.- Parameters:
key- the reference key, notnullnextKey- the required key, ornullto represent the tail of the list- Returns:
- this operation, not
null
-
ifLast
Adds a condition that requires the specifiedkeyto be the last in the list.- Parameters:
key- the key, notnull- Returns:
- this operation, not
null
-
ifPrev
Adds a condition that requires the specifiedprevKeyto be right before the specifiedkeywhen the operation is applied. AnullprevKeycan be used to represent the head of the list.- Parameters:
key- the reference key, notnullprevKey- the required key, ornullto represent the head of the list- Returns:
- this operation, not
null
-
ifFirst
Adds a condition that requires the specifiedkeyto be the first in the list.- Parameters:
key- the key, notnull- Returns:
- this operation, not
null
-
ifEmpty
Adds a condition that requires the list to be empty.- Returns:
- this operation, not
null
-
ifNotEmpty
Adds a condition that requires the list not to be empty.- Returns:
- this operation, not
null
-
ifValue
Add a condition that requires the specifiedkeyto have the specifiedvalue.- Parameters:
key- the key, notnullvalue- the expected value- Returns:
- this operation, not
null
-