ModelCodec

public final class ModelCodec
extends Object

java.lang.Object
   ↳ android.support.test.espresso.web.model.ModelCodec


Encodes/Decodes JSON.

Summary

Public methods

static void addDeJSONFactory(JSONAble.DeJSONFactory dejson)

Adds a DeJSONFactory to intercept JSONObjects and replace them with more suitable types.

static Evaluation decodeEvaluation(String json)

Transforms a JSON string to an evaluation.

static String encode(Object javaObject)

Encodes a Java Object into a JSON string.

static void removeDeJSONFactory(JSONAble.DeJSONFactory dejson)

Removes a DeJSONFactory from the list of factories that transform JSONObjects to java objects.

Inherited methods

From class java.lang.Object

Public methods

addDeJSONFactory

void addDeJSONFactory (JSONAble.DeJSONFactory dejson)

Adds a DeJSONFactory to intercept JSONObjects and replace them with more suitable types.

Parameters
dejson JSONAble.DeJSONFactory

decodeEvaluation

Evaluation decodeEvaluation (String json)

Transforms a JSON string to an evaluation.

Parameters
json String

Returns
Evaluation

encode

String encode (Object javaObject)

Encodes a Java Object into a JSON string.

Parameters
javaObject Object

Returns
String

removeDeJSONFactory

void removeDeJSONFactory (JSONAble.DeJSONFactory dejson)

Removes a DeJSONFactory from the list of factories that transform JSONObjects to java objects.

Parameters
dejson JSONAble.DeJSONFactory