Class JSONResponse

    • Field Detail

      • RESPONSE_CONTENT_TYPE

        public static final java.lang.String RESPONSE_CONTENT_TYPE
        See Also:
        Constant Field Values
    • Constructor Detail

      • JSONResponse

        public JSONResponse()
    • Method Detail

      • onChange

        public void onChange​(java.lang.String type,
                             java.lang.String... arguments)
        Description copied from interface: PostResponse
        Records a generic change of the given type with arguments.
        Parameters:
        type - The type of the modification
        arguments - The arguments to the modifications
      • setError

        public void setError​(java.lang.Throwable error)
        Description copied from interface: PostResponse
        Sets the recorded error causing the operation to fail.
        Specified by:
        setError in interface PostResponse
        Overrides:
        setError in class AbstractPostResponse
        Parameters:
        error - the throwable
      • setProperty

        public void setProperty​(java.lang.String name,
                                java.lang.Object value)
        This method accepts values that correspond to json primitives or otherwise assumes that the toString() of the value can be parsed as json. If neither is the case it will throw an Exception. Assuming the above holds, it will put the value as json directly into the json value part of the response.
        Parameters:
        name - name of the property
        value - value of the property - either of type {String, Boolean, Number, null} or the toString() is parseable as json
        Throws:
        JSONResponse.JSONResponseException - if the value is not usable
      • getProperty

        public java.lang.Object getProperty​(java.lang.String name)