Package com.swrve.sdk
Class UIThreadSwrveUserResourcesDiffListener
- java.lang.Object
-
- com.swrve.sdk.UIThreadSwrveUserResourcesDiffListener
-
- All Implemented Interfaces:
SwrveUserResourcesDiffListener
public class UIThreadSwrveUserResourcesDiffListener extends java.lang.Object implements SwrveUserResourcesDiffListener
This helper class is used to run UI logic to handle the result of Swrve::getUserResourcesDiff() Note: the Runnable uiWork will be called from the context of the Activity.
-
-
Constructor Summary
Constructors Constructor Description UIThreadSwrveUserResourcesDiffListener(android.app.Activity context, UIThreadSwrveResourcesDiffRunnable uiWork)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onUserResourcesDiffError(java.lang.Exception exception)
Called back on error.void
onUserResourcesDiffSuccess(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> oldResources, java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> newResources, java.lang.String resourcesAsJSON)
This method is invoked asynchronously to return the request response of the Swrve::getUserResourceDiffs().
-
-
-
Constructor Detail
-
UIThreadSwrveUserResourcesDiffListener
public UIThreadSwrveUserResourcesDiffListener(android.app.Activity context, UIThreadSwrveResourcesDiffRunnable uiWork)
-
-
Method Detail
-
onUserResourcesDiffSuccess
public void onUserResourcesDiffSuccess(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> oldResources, java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> newResources, java.lang.String resourcesAsJSON)
Description copied from interface:SwrveUserResourcesDiffListener
This method is invoked asynchronously to return the request response of the Swrve::getUserResourceDiffs(). Note: this method is invoked from a different thread than the thread used to call Swrve::getUserResourceDiffs().- Specified by:
onUserResourcesDiffSuccess
in interfaceSwrveUserResourcesDiffListener
- Parameters:
oldResources
- the old values of AB Tested resources represented as a map in the form uid=(attribute_name=attribute_value).newResources
- the new values of AB Tested resources represented as a map in the form uid=(attribute_name=attribute_value).resourcesAsJSON
- the resources as JSON.
-
onUserResourcesDiffError
public void onUserResourcesDiffError(java.lang.Exception exception)
Description copied from interface:SwrveUserResourcesDiffListener
Called back on error.- Specified by:
onUserResourcesDiffError
in interfaceSwrveUserResourcesDiffListener
- Parameters:
exception
- Exception caused when trying to obtain user resources.
-
-