Class SortPositionRequest
- java.lang.Object
-
- com.broadleafcommerce.data.tracking.core.sort.SortPositionRequest
-
public class SortPositionRequest extends Object
Represents a request to update an entity identified byupdateContextId
with a new sort value that is calculated by identifying the entity it should be positioned after (specified viapositionAfterContextId
). If thepositionAfterContextId
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 aSortPositionStrategy
instance.SortPositionRequestHandlerMethodArgumentResolver
allows for dynamic creation ofSortPositionRequest
when the class is used as a method parameter in aController
. By default, it will populate the request using the request's path forupdateContextId
and a parameter forpositionAfterContextId
. To specify non-default values for the names of path variable and URL parameter, seeUpdateSortOperation
.- Author:
- Jeff Fischer
- See Also:
UpdateSortOperation
,SortPositionRequestHandlerMethodArgumentResolver
-
-
Constructor Summary
Constructors Constructor Description SortPositionRequest(String updateContextId)
SortPositionRequest(String positionAfterContextId, String positionBeforeContextId, String updateContextId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
canEqual(Object other)
boolean
equals(Object o)
String
getPositionAfterContextId()
Context ID of the item after which to place the item specified byupdateContextId
.String
getPositionBeforeContextId()
Context ID of the item before which to place the item specified byupdateContextId
.String
getUpdateContextId()
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
.String
toString()
SortPositionRequest
withAfterContextId(String afterContextId)
SortPositionRequest
withBeforeContextId(String beforeContextId)
-
-
-
Method Detail
-
withAfterContextId
public SortPositionRequest withAfterContextId(String afterContextId)
-
withBeforeContextId
public SortPositionRequest withBeforeContextId(String beforeContextId)
-
getPositionAfterContextId
public String 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
public String 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
public String getUpdateContextId()
Context ID of the item for whichSortable.getSorting()
should be updated.
-
setPositionAfterContextId
public void setPositionAfterContextId(String positionAfterContextId)
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
public void setPositionBeforeContextId(String positionBeforeContextId)
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.
-
canEqual
protected boolean canEqual(Object other)
-
-