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.BaseListQueryBuilderfor creating instance of this class. Except for array query parameters, allNullableparameters means you can remove the query parameter by passing anullvalue.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classBaseListQueryParams.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 protectedBaseListQueryParams()Default constructor which is set toprotected.protectedBaseListQueryParams(android.os.Parcel in)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCategories(java.lang.String... categories)Add categories to filter the listvoidaddCategory(java.lang.String category)Add a category to filter the list.voidclearCategories()Clear all the categoriesintdescribeContents()java.util.List<java.lang.String>getCategories()java.lang.IntegergetItemsPerPage()java.lang.StringgetLayout()java.lang.IntegergetPage()java.lang.StringgetSortBy()SortOrdergetSortOrder()voidremoveCategory(java.lang.String category)Remove a category to the existing list of categoriesvoidsetItemsPerPage(java.lang.Integer itemsPerPage)Set the max items per pagevoidsetLayout(Layout layout)Define the layout template from the consolevoidsetPage(java.lang.Integer page)Set the offset page parametervoidsetSortBy(java.lang.String sortBy)Set the property name that will be used to arrange the listvoidsetSortOrder(SortOrder order)Set the sort order of the listvoidwriteToParcel(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.BaseListQueryBuilderto instantiate this class
-
BaseListQueryParams
protected BaseListQueryParams(android.os.Parcel in)
-
-
Method Detail
-
describeContents
public int describeContents()
- Specified by:
describeContentsin interfaceandroid.os.Parcelable- Overrides:
describeContentsin classBaseParams
-
writeToParcel
@CallSuper public void writeToParcel(android.os.Parcel dest, int flags)- Specified by:
writeToParcelin interfaceandroid.os.Parcelable- Overrides:
writeToParcelin 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
-
-