Class BaseListQueryParams
- java.lang.Object
-
- com.cheetahdigital.corekit.rest.params.BaseParams
-
- com.cheetahdigital.corekit.rest.params.BaseListQueryParams
-
- All Implemented Interfaces:
android.os.Parcelable
- Direct Known Subclasses:
ActivityParams
,AuthenticationFieldParams
,AuthenticationQueryParams
,BadgeParams
,BeaconFields
,BeaconsParams
,ChallengeParams
,CodesParams
,ConnectionsParams
,ContentPagesParams
,ContentTokenParams
,EventsParams
,FeedbackParams
,FriendsParams
,GiftcardParams
,GroupsParams
,HouseholdParams
,InfoQueryParams
,LeaderboardParams
,MembersParams
,MessagesParams
,MetaReferencesParams
,NewsfeedParams
,OfferParams
,OrderParams
,PaymentParams
,PlacesParams
,PreferencesParams
,ProductsParams
,ProfileParams
,PunchcardParams
,ReceiptParams
,ReferralParams
,RewardParams
,StaticFilesParams
,SummaryParams
,TrackingParams
,TransactionsParams
,UpgradeCheckParams
public class BaseListQueryParams extends BaseParams
Base class for list query parameters. Use implementation class ofBaseListQueryParams.BaseListQueryBuilder
for creating instance of this class. Except for array query parameters, allNullable
parameters means you can remove the query parameter by passing anull
value.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
BaseListQueryParams.BaseListQueryBuilder<P extends BaseListQueryParams,B extends BaseListQueryParams.BaseListQueryBuilder>
Abstract builder class for creating subclasses ofBaseListQueryParams
-
Nested classes/interfaces inherited from class com.cheetahdigital.corekit.rest.params.BaseParams
BaseParams.BaseBuilder<T extends BaseParams,B extends BaseParams.BaseBuilder>
-
-
Field Summary
Fields Modifier and Type Field Description static android.os.Parcelable.Creator<BaseListQueryParams>
CREATOR
-
Fields inherited from class com.cheetahdigital.corekit.rest.params.BaseParams
mId, mQueryMap
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
BaseListQueryParams()
Default constructor which is set toprotected
.protected
BaseListQueryParams(android.os.Parcel in)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCategories(java.lang.String... categories)
Add categories to filter the listvoid
addCategory(java.lang.String category)
Add a category to filter the list.void
clearCategories()
Clear all the categoriesint
describeContents()
java.util.List<java.lang.String>
getCategories()
java.lang.Integer
getItemsPerPage()
java.lang.String
getLayout()
java.lang.Integer
getPage()
java.lang.String
getSortBy()
SortOrder
getSortOrder()
void
removeCategory(java.lang.String category)
Remove a category to the existing list of categoriesvoid
setItemsPerPage(java.lang.Integer itemsPerPage)
Set the max items per pagevoid
setLayout(Layout layout)
Define the layout template from the consolevoid
setPage(java.lang.Integer page)
Set the offset page parametervoid
setSortBy(java.lang.String sortBy)
Set the property name that will be used to arrange the listvoid
setSortOrder(SortOrder order)
Set the sort order of the listvoid
writeToParcel(android.os.Parcel dest, int flags)
-
Methods inherited from class com.cheetahdigital.corekit.rest.params.BaseParams
addParam, getAccessToken, getId, getParam, getQueryMap, setAccessToken, setId
-
-
-
-
Field Detail
-
CREATOR
public static final android.os.Parcelable.Creator<BaseListQueryParams> CREATOR
-
-
Constructor Detail
-
BaseListQueryParams
protected BaseListQueryParams()
Default constructor which is set toprotected
. Use implementation class ofBaseListQueryParams.BaseListQueryBuilder
to instantiate this class
-
BaseListQueryParams
protected BaseListQueryParams(android.os.Parcel in)
-
-
Method Detail
-
describeContents
public int describeContents()
- Specified by:
describeContents
in interfaceandroid.os.Parcelable
- Overrides:
describeContents
in classBaseParams
-
writeToParcel
@CallSuper public void writeToParcel(android.os.Parcel dest, int flags)
- Specified by:
writeToParcel
in interfaceandroid.os.Parcelable
- Overrides:
writeToParcel
in classBaseParams
-
addCategories
public void addCategories(@NonNull java.lang.String... categories)
Add categories to filter the list- Parameters:
categories
- categories to filter
-
addCategory
public void addCategory(@NonNull java.lang.String category)
Add a category to filter the list.- Parameters:
category
- category to filter.
-
removeCategory
public void removeCategory(@NonNull java.lang.String category)
Remove a category to the existing list of categories- Parameters:
category
- category to be removed
-
clearCategories
public void clearCategories()
Clear all the categories
-
setLayout
public void setLayout(@Nullable Layout layout)
Define the layout template from the console- Parameters:
layout
- the layout template
-
setPage
public void setPage(@Nullable java.lang.Integer page)
Set the offset page parameter- Parameters:
page
- offset page parameter
-
setItemsPerPage
public void setItemsPerPage(@Nullable java.lang.Integer itemsPerPage)
Set the max items per page- Parameters:
itemsPerPage
- max items per page
-
setSortOrder
public void setSortOrder(@Nullable SortOrder order)
Set the sort order of the list- Parameters:
order
- TheSortOrder
. Can either be ascending or descending
-
setSortBy
public void setSortBy(@Nullable java.lang.String sortBy)
Set the property name that will be used to arrange the list- Parameters:
sortBy
- The property name. Refer toSortBy
(may not be updated).
-
getCategories
@Nullable public java.util.List<java.lang.String> getCategories()
- Returns:
- list of categories
-
getLayout
@Nullable public java.lang.String getLayout()
- Returns:
- layout template
-
getPage
@Nullable public java.lang.Integer getPage()
- Returns:
- offset page parameter
-
getItemsPerPage
@Nullable public java.lang.Integer getItemsPerPage()
- Returns:
- max items per page of the list
-
getSortOrder
@Nullable public SortOrder getSortOrder()
- Returns:
- sort order of the list
-
getSortBy
@Nullable public java.lang.String getSortBy()
- Returns:
- property name used to arrange the list
-
-