Class URLNotificationJSONConverter


  • public class URLNotificationJSONConverter
    extends java.lang.Object
    • Field Detail

      • ATTRIBUTE_PRODUCT_ID

        public static final java.lang.String ATTRIBUTE_PRODUCT_ID
        attribute for product id
        See Also:
        Constant Field Values
      • ATTRIBUTE_SOURCE

        public static final java.lang.String ATTRIBUTE_SOURCE
        attribute for source
        See Also:
        Constant Field Values
      • ATTRIBUTE_TYPE

        public static final java.lang.String ATTRIBUTE_TYPE
        attribute for type
        See Also:
        Constant Field Values
      • ATTRIBUTE_CODE

        public static final java.lang.String ATTRIBUTE_CODE
        attribute for code
        See Also:
        Constant Field Values
      • ATTRIBUTE_UPDATE_TIME

        public static final java.lang.String ATTRIBUTE_UPDATE_TIME
        attribute for updatetime
        See Also:
        Constant Field Values
      • ATTRIBUTE_TRACKER_URL

        public static final java.lang.String ATTRIBUTE_TRACKER_URL
        attribute for trackerURL
        See Also:
        Constant Field Values
      • ATTRIBUTE_EXPIRES

        public static final java.lang.String ATTRIBUTE_EXPIRES
        attribute for expires
        See Also:
        Constant Field Values
      • ATTRIBUTE_URL

        public static final java.lang.String ATTRIBUTE_URL
        attribute for url
        See Also:
        Constant Field Values
    • Constructor Detail

      • URLNotificationJSONConverter

        public URLNotificationJSONConverter()
    • Method Detail

      • toJSON

        public static java.lang.String toJSON​(URLNotification notification)
        Converts a URLNotification into a JSON string
        Parameters:
        notification - URLNotification to convert
        Returns:
        JSON string
      • parseJSON

        public static URLNotification parseJSON​(java.io.InputStream message)
                                         throws java.lang.Exception
        parse a message from the input stream
        Parameters:
        message - InputStream message
        Returns:
        URLNotification
        Throws:
        java.lang.Exception - if error occurs
      • parseJSON

        public static URLNotification parseJSON​(javax.json.JsonObject json)
                                         throws java.lang.Exception
        Parse a JsonObject
        Parameters:
        json - JsonObject
        Returns:
        URLNotification
        Throws:
        java.lang.Exception - if error occurs
      • main

        public static void main​(java.lang.String[] args)
                         throws java.lang.Exception
        Main function to run a test JSON-ifying a URLnotification
        Parameters:
        args - arguments
        Throws:
        java.lang.Exception - if error occurs