Class ItemActivityListParser

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

public class ItemActivityListParser extends Object implements GsonParser<List<ItemActivity>>
Parses a response body that contains a list of ItemActivity objects.

Example response body:

 {
   "value": [
     {
       "action": {
         "comment": {}
       },
       "actor": {
         "user": {
           "displayName": "Xavier Wilke"
         }
       },
       "id": "EJalEvjV1EgIYFQAAAAAAA==",
       "times": {
           "recordedDateTime": "2017-07-29T18:34:40Z"
       }
     },
   {
       "action": {
         "edit": {},
         "version": {
           "newVersion": "2.0"
         }
       },
       "actor": {
         "user": {
           "displayName": "Judith Clemons"
         }
       },
       "id": "cInT6/fV1EgFYFQAAAAAAA==",
       "times": {
         "recordedDateTime": "2017-07-29T16:23:35Z"
       }
     },
     {
       "action": {
         "mention": {
           "mentionees": [
             {
               "user": {
                 "displayName": "Judith Clemons"
               }
             }
           ]
         }
       },
       "actor": {
         "user": {
           "displayName": "Misty Suarez"
         }
       },
       "id": "EBJa0vPV1EjFX1QAAAAAAA==",
       "times": {
         "recordedDateTime": "2017-07-28T20:14:14Z"
       }
     },
     {
       "action": {
         "rename": {
           "oldName": "Document2.docx"
         }
       },
       "actor": {
         "user": {
           "displayName": "Misty Suarez"
         }
       },
       "id": "QFJFlfPV1Ei/X1QAAAAAAA==",
       "times": {
         "recordedDateTime": "2017-07-28T20:12:32Z"
       }
     },
     {
       "action": {
         "create": {}
       },
       "actor": {
         "user": {
           "displayName": "Misty Suarez"
         }
       },
       "id": "IJydkPPV1Ei9X1QAAAAAAA==",
       "times": {
         "recordedDateTime": "2017-07-28T20:02:24Z"
       }
     }
   ]
 }
 
API Documentation
See Also:
  • Constructor Details

    • ItemActivityListParser

      public ItemActivityListParser()
  • Method Details

    • parse

      public List<ItemActivity> 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<ItemActivity>>
      Parameters:
      gson - the Gson instance used to deserialize the string
      jsonStream - stream with expected JSON-formatted contents
      Returns:
      the parsed POJO instance