Examples of GsonDateTimeSerializer


Examples of com.elastisys.scale.commons.json.typeadapters.GsonDateTimeSerializer

   * @return The JSON-serialized representation of the object.
   */
  public static JsonElement toJson(Object object, boolean serializeNullFields) {
    Preconditions.checkNotNull(object, "null object not allowed");
    GsonBuilder gsonBuilder = new GsonBuilder().registerTypeAdapter(
        DateTime.class, new GsonDateTimeSerializer());
    if (serializeNullFields) {
      gsonBuilder.serializeNulls();
    }
    Gson gson = gsonBuilder.create();
    return gson.toJsonTree(object);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.