Class SortPositionRequest
java.lang.Object
com.broadleafcommerce.data.tracking.core.sort.SortPositionRequest
Represents a request to update an entity identified by
updateContextId
with a new sort
value that is calculated by identifying the entity it should be positioned after (specified via
positionAfterContextId
). If the positionAfterContextId
value is not specified,
it is assumed the request is to set the new sort value to the first position in the sorted group.
This request generally works in conjunction with Sorted
business domain, Sortable
repository domain, and a SortPositionStrategy
instance.
SortPositionRequestHandlerMethodArgumentResolver
allows for dynamic creation of
SortPositionRequest
when the class is used as a method parameter in a
Controller
. By default, it will populate the request
using the request's path for updateContextId
and a parameter for
positionAfterContextId
. To specify non-default values for the names of path variable and
URL parameter, see UpdateSortOperation
.
- Author:
- Jeff Fischer
- See Also:
-
Constructor Summary
ConstructorDescriptionSortPositionRequest
(String updateContextId) SortPositionRequest
(String positionAfterContextId, String positionBeforeContextId, String updateContextId) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
Context ID of the item after which to place the item specified byupdateContextId
.Context ID of the item before which to place the item specified byupdateContextId
.Context ID of the item for whichSortable.getSorting()
should be updated.int
hashCode()
void
setPositionAfterContextId
(String positionAfterContextId) Context ID of the item after which to place the item specified byupdateContextId
.void
setPositionBeforeContextId
(String positionBeforeContextId) Context ID of the item before which to place the item specified byupdateContextId
.toString()
withAfterContextId
(String afterContextId) withBeforeContextId
(String beforeContextId)
-
Constructor Details
-
SortPositionRequest
-
SortPositionRequest
-
-
Method Details
-
withAfterContextId
-
withBeforeContextId
-
getPositionAfterContextId
Context ID of the item after which to place the item specified byupdateContextId
. Optional. If neither this norpositionBeforeContextId
are provided, this means that the item should move to the 1st position relative to other items. -
getPositionBeforeContextId
Context ID of the item before which to place the item specified byupdateContextId
. Optional. If neither this norpositionAfterContextId
are provided, this means that the item should move to the 1st position relative to other items.Note that
positionAfterContextId
takes precedence if both are present. -
getUpdateContextId
Context ID of the item for whichSortable.getSorting()
should be updated. -
setPositionAfterContextId
Context ID of the item after which to place the item specified byupdateContextId
. Optional. If neither this norpositionBeforeContextId
are provided, this means that the item should move to the 1st position relative to other items. -
setPositionBeforeContextId
Context ID of the item before which to place the item specified byupdateContextId
. Optional. If neither this norpositionAfterContextId
are provided, this means that the item should move to the 1st position relative to other items.Note that
positionAfterContextId
takes precedence if both are present. -
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-