Class BaseParams
- java.lang.Object
-
- com.cheetahdigital.corekit.rest.params.BaseParams
-
- All Implemented Interfaces:
android.os.Parcelable
- Direct Known Subclasses:
BaseListQueryParams,ChallengeFields,ChallengeHeaders,ChallengeParts,ConnectionsFields,FeedbackFields,GiftcardFields,HouseholdFields,MembersFields,NewsfeedFields,OrderFields,PlacesFields,PreferencesFields,ProfileFields,RewardFields
public class BaseParams extends java.lang.Object implements android.os.ParcelableBase class for implementing the parameters that will be used for API calls
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classBaseParams.BaseBuilder<T extends BaseParams,B extends BaseParams.BaseBuilder>Abstract builder class for creating subclasses ofBaseParams
-
Field Summary
Fields Modifier and Type Field Description static android.os.Parcelable.Creator<BaseParams>CREATORprotected java.lang.StringmIdprotected java.util.Map<java.lang.String,java.lang.Object>mQueryMap
-
Constructor Summary
Constructors Modifier Constructor Description protectedBaseParams()protectedBaseParams(android.os.Parcel in)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddParam(java.lang.String param, java.lang.Object value)Add a parameter to the existing query map.intdescribeContents()java.lang.StringgetAccessToken()java.lang.StringgetId()<T> TgetParam(java.lang.String param)Returns thevaluefrom the query map using theparamas keyjava.util.Map<java.lang.String,java.lang.Object>getQueryMap()Returns the query mapvoidsetAccessToken(java.lang.String accessToken)Set the access token used for current api callvoidsetId(java.lang.String id)Set the module id or module internal namevoidwriteToParcel(android.os.Parcel dest, int flags)
-
-
-
Field Detail
-
mQueryMap
protected java.util.Map<java.lang.String,java.lang.Object> mQueryMap
-
mId
protected java.lang.String mId
-
CREATOR
public static final android.os.Parcelable.Creator<BaseParams> CREATOR
-
-
Method Detail
-
describeContents
public int describeContents()
- Specified by:
describeContentsin interfaceandroid.os.Parcelable
-
writeToParcel
@CallSuper public void writeToParcel(android.os.Parcel dest, int flags)- Specified by:
writeToParcelin interfaceandroid.os.Parcelable
-
addParam
@CallSuper public void addParam(@NonNull java.lang.String param, @Nullable java.lang.Object value)Add a parameter to the existing query map. Ifvalueis null, it will be removed from the query map- Parameters:
param- the parameter keyvalue- parameter value
-
getParam
@CallSuper public <T> T getParam(java.lang.String param)
Returns thevaluefrom the query map using theparamas key- Type Parameters:
T- expected type of the object- Parameters:
param- the key to be used for retrieving the value from the query map- Returns:
- current object with type T stored in the map, else null
-
setId
public void setId(java.lang.String id)
Set the module id or module internal name- Parameters:
id- the id or internal name of the module
-
getId
public java.lang.String getId()
- Returns:
- the module id
-
setAccessToken
public void setAccessToken(@Nullable java.lang.String accessToken)Set the access token used for current api call- Parameters:
accessToken- the access token to use for the call
-
getAccessToken
@Nullable public java.lang.String getAccessToken()
- Returns:
- access token of the current params
-
getQueryMap
public java.util.Map<java.lang.String,java.lang.Object> getQueryMap()
Returns the query map- Returns:
- the current query map
-
-