Package com.google.gson

Examples of com.google.gson.JsonObject.addProperty()


      if (libraryDriveObject == null) {
         libraryDriveObject = new JsonObject();
      }

      libraryDriveObject.addProperty("favourite", input.isFavorite());

      if (input.getDescription() != null) {
         libraryDriveObject.addProperty("description", input.getDescription());
      }
      return libraryDriveObject;
View Full Code Here


      }

      libraryDriveObject.addProperty("favourite", input.isFavorite());

      if (input.getDescription() != null) {
         libraryDriveObject.addProperty("description", input.getDescription());
      }
      return libraryDriveObject;
   }
}
View Full Code Here

   @Override
   public JsonObject apply(DriveInfo input) {
      JsonObject driveObject = new JsonObject();

      if (input.getName() != null) {
         driveObject.addProperty("name", input.getName());
      }

      if (input.getSize() != null) {
         driveObject.addProperty("size", "" + input.getSize().toString());
      }
View Full Code Here

      if (input.getName() != null) {
         driveObject.addProperty("name", input.getName());
      }

      if (input.getSize() != null) {
         driveObject.addProperty("size", "" + input.getSize().toString());
      }

      if (input.getMedia() != null) {
         driveObject.addProperty("media", input.getMedia().toString());
      }
View Full Code Here

      if (input.getSize() != null) {
         driveObject.addProperty("size", "" + input.getSize().toString());
      }

      if (input.getMedia() != null) {
         driveObject.addProperty("media", input.getMedia().toString());
      }

      if (input.getAffinities() != null) {
         driveObject.add("affinities", new JsonParser().parse(new Gson().toJson(input.getAffinities())));
      }
View Full Code Here

      if (input.getTags() != null) {
         driveObject.add("tags", new JsonParser().parse(new Gson().toJson(input.getTags())));
      }

      driveObject.addProperty("allow_multimount", input.isAllowMultimount());
      return driveObject;
   }
}
View Full Code Here

      }

      JsonObject createSubscriptionObject = new JsonObject();

      if (input.getAmount() != null) {
         createSubscriptionObject.addProperty("amount", input.getAmount());
      }

      if (input.getPeriod() != null) {
         createSubscriptionObject.addProperty("period", input.getPeriod());
      }
View Full Code Here

      if (input.getAmount() != null) {
         createSubscriptionObject.addProperty("amount", input.getAmount());
      }

      if (input.getPeriod() != null) {
         createSubscriptionObject.addProperty("period", input.getPeriod());
      }

      if (input.getResource() != null) {
         createSubscriptionObject.addProperty("resource", input.getResource().value());
      }
View Full Code Here

      if (input.getPeriod() != null) {
         createSubscriptionObject.addProperty("period", input.getPeriod());
      }

      if (input.getResource() != null) {
         createSubscriptionObject.addProperty("resource", input.getResource().value());
      }

      return createSubscriptionObject;
   }
}
View Full Code Here

      JsonArray uuidJsonArray = new JsonArray();
      JsonObject json = new JsonObject();

      for (String uuid : uuids) {
         JsonObject uuidObject = new JsonObject();
         uuidObject.addProperty("uuid", uuid);
         uuidJsonArray.add(uuidObject);
      }

      json.add("objects", uuidJsonArray);
      request.setPayload(json.toString());
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.