Class StitchRequestSerDe


  • public class StitchRequestSerDe
    extends java.lang.Object
    Methods to serialize and deserialize the body of a stitch request. The body of the request should be a JSON object that contains an array field with the key, "signedChunkIds". Each element of the array should be a signed ID produced by an IdSigningService implementation representing a data chunk to be stitched together. The order of the IDs in the array will be the order in which the data chunks are stitched. For example:
    
     {
       "signedChunkIds": ["/signedId/id1", "/signedId/id2", "..."]
     }
     
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<java.lang.String> fromJson​(org.json.JSONObject stitchRequestJson)  
      static org.json.JSONObject toJson​(java.util.List<java.lang.String> signedChunkIds)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • toJson

        public static org.json.JSONObject toJson​(java.util.List<java.lang.String> signedChunkIds)
        Parameters:
        signedChunkIds - the list of signed chunk IDs to stitch together.
        Returns:
        a JSONObject representing the request.
      • fromJson

        public static java.util.List<java.lang.String> fromJson​(org.json.JSONObject stitchRequestJson)
        Parameters:
        stitchRequestJson - the JSON object to extract the list of signed chunk IDs from.
        Returns:
        a List that contains the signed chunk IDs to be stitched.