com.google.caliper
Class Json

java.lang.Object
  extended by com.google.caliper.Json

public final class Json
extends Object

Ordinarily serialization should be done within the class that is being serialized. However, many of these classes are used by GWT, which dies when it sees Gson.


Method Summary
static com.google.gson.Gson getGsonInstance()
           
static MeasurementSet measurementSetFromJson(com.google.gson.JsonObject measurementSetJson)
           
static MeasurementSet measurementSetFromJson(String measurementSetJson)
          Attempts to extract a MeasurementSet from a string, assuming it is JSON.
static String measurementSetToJson(MeasurementSet measurementSet)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getGsonInstance

public static com.google.gson.Gson getGsonInstance()

measurementSetToJson

public static String measurementSetToJson(MeasurementSet measurementSet)

measurementSetFromJson

public static MeasurementSet measurementSetFromJson(String measurementSetJson)
Attempts to extract a MeasurementSet from a string, assuming it is JSON. If this fails, it tries to extract it from the string assuming it is a space-separated list of double values.


measurementSetFromJson

public static MeasurementSet measurementSetFromJson(com.google.gson.JsonObject measurementSetJson)


Copyright © 2009-2011 Google, Inc.. All Rights Reserved.