Class UpdatePreferencesPresenter<T extends UpdatePreferencesView>
- java.lang.Object
-
- com.cheetahdigital.uikit.architecture.mvp.MvpNullObjectBasePresenter<V>
-
- com.cheetahdigital.uikit.architecture.mvp.Presenter<T>
-
- com.cheetahdigital.challenges.ui.responses.base.ChallengeResponsePresenter<T>
-
- com.cheetahdigital.challenges.ui.responses.profile.preferences.UpdatePreferencesPresenter<T>
-
- All Implemented Interfaces:
MvpPresenter<T>
public class UpdatePreferencesPresenter<T extends UpdatePreferencesView> extends ChallengeResponsePresenter<T>
Presenter that is used byUpdatePreferencesFragment
-
-
Constructor Summary
Constructors Constructor Description UpdatePreferencesPresenter(java.lang.String id, java.lang.String responseId, UpdatePrefsResponseSetting responseSetting)
Create the presenter with defaultChallengeParams
UpdatePreferencesPresenter(java.lang.String id, java.lang.String responseId, UpdatePrefsResponseSetting responseSetting, ChallengeParams params)
Create the presenter with a givenChallengeParams
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected okhttp3.RequestBody
getRequestBody(java.lang.String json)
Get Request Bodyvoid
init()
Initialize theUpdatePreferencesView
protected java.lang.String
serialize(java.util.List<Preference> preferences)
void
updatePrefs(java.util.List<Preference> preferences)
Submit challenge response to update selected preferences-
Methods inherited from class com.cheetahdigital.challenges.ui.responses.base.ChallengeResponsePresenter
getChallengesAPI, getRespondListener, onRespondFailed, onRespondSuccess, submitChallengeResponse, submitChallengeResponse, submitChallengeResponse, submitChallengeResponse, submitChallengeResponse, submitChallengeResponse
-
Methods inherited from class com.cheetahdigital.uikit.architecture.mvp.MvpNullObjectBasePresenter
attachView, detachView, getView
-
-
-
-
Constructor Detail
-
UpdatePreferencesPresenter
public UpdatePreferencesPresenter(java.lang.String id, java.lang.String responseId, UpdatePrefsResponseSetting responseSetting)
Create the presenter with defaultChallengeParams
- Parameters:
id
- challenge idresponseId
- response idresponseSetting
- theUpdatePrefsResponseSetting
-
UpdatePreferencesPresenter
public UpdatePreferencesPresenter(java.lang.String id, java.lang.String responseId, UpdatePrefsResponseSetting responseSetting, ChallengeParams params)
Create the presenter with a givenChallengeParams
- Parameters:
id
- challenge idresponseId
- response idresponseSetting
- theUpdatePrefsResponseSetting
params
- theChallengeParams
-
-
Method Detail
-
init
public void init()
Initialize theUpdatePreferencesView
-
updatePrefs
public void updatePrefs(java.util.List<Preference> preferences)
Submit challenge response to update selected preferences- Parameters:
preferences
- list ofPreference
-
getRequestBody
@NotNull protected okhttp3.RequestBody getRequestBody(java.lang.String json)
Get Request Body- Parameters:
json
- json to be added in the request bofy- Returns:
- Request Body
-
serialize
protected java.lang.String serialize(java.util.List<Preference> preferences)
-
-