use of com.bluelinelabs.logansquare.demo.serializetasks.LoganSquareSerializer in project LoganSquare by bluelinelabs.
the class MainActivity method performSerializeTests.
private void performSerializeTests() {
mBarChart.clear();
mBarChart.setSections(new String[] { "Serialize 60 items", "Serialize 20 items", "Serialize 7 items", "Serialize 2 items" });
Gson gson = new Gson();
ObjectMapper objectMapper = new ObjectMapper();
Moshi moshi = new Moshi.Builder().build();
List<Serializer> serializers = new ArrayList<>();
for (Response response : mResponsesToSerialize) {
for (int iteration = 0; iteration < ITERATIONS; iteration++) {
serializers.add(new GsonSerializer(mSerializeListener, response, gson));
serializers.add(new JacksonDatabindSerializer(mSerializeListener, response, objectMapper));
serializers.add(new LoganSquareSerializer(mSerializeListener, response));
serializers.add(new MoshiSerializer(mSerializeListener, response, moshi));
}
}
for (Serializer serializer : serializers) {
serializer.executeOnExecutor(AsyncTask.SERIAL_EXECUTOR);
}
}
Aggregations