Class DriveItemListParser

java.lang.Object
com.amilesend.onedrive.parse.resource.parser.DriveItemListParser
All Implemented Interfaces:
GsonParser<List<DriveItem>>

public class DriveItemListParser extends Object implements GsonParser<List<DriveItem>>
Parses a response body that contains a list of DriveItems.

Example response body:

 {
   "value": [
     {"name": "myfile.jpg", "size": 2048, "file": {} },
     {"name": "Documents", "folder": { "childCount": 4} },
     {"name": "Photos", "folder": { "childCount": 203} },
     {"name": "my sheet(1).xlsx", "size": 197 }
   ]
 }
 
API Documentation
See Also:
  • Constructor Details

    • DriveItemListParser

      public DriveItemListParser()
  • Method Details

    • parse

      public List<DriveItem> parse(@NonNull com.google.gson.Gson gson, @NonNull InputStream jsonStream)
      Description copied from interface: GsonParser
      Deserializes a JSON-formatted input stream to the defined POJO type.
      Specified by:
      parse in interface GsonParser<List<DriveItem>>
      Parameters:
      gson - the Gson instance used to deserialize the string
      jsonStream - stream with expected JSON-formatted contents
      Returns:
      the parsed POJO instance