private static final Logger log = LoggerFactory.getLogger(JsonModelDistributionAdapter.class);
@Override
public JsonElement serialize(ModelDistribution<?> src, Type typeOfSrc, JsonSerializationContext context) {
GsonBuilder builder = new GsonBuilder();
builder.registerTypeAdapter(Vector.class, new JsonVectorAdapter());
builder.registerTypeAdapter(DistanceMeasure.class, new JsonDistanceMeasureAdapter());
Gson gson = builder.create();
JsonObject obj = new JsonObject();
obj.add("class", new JsonPrimitive(src.getClass().getName()));
obj.add("model", new JsonPrimitive(gson.toJson(src)));