Package com.restfb

Class Body


  • public class Body
    extends Object
    The POST body class. It uses the RestFB JsonMapper to convert an object to json String.

    You can use your custom mapper to modify the mapping.

    • Method Detail

      • getData

        public String getData()
        returns the Body data as String
        Returns:
        the body data
      • withData

        public static Body withData​(Object data)
        build a new body object instance with the given data as immutable inner data
        Parameters:
        data - the data is internally converted into a String using the JsonMapper
        Returns:
        the Body instance
      • withData

        public static Body withData​(Object data,
                                    JsonMapper jsonMapper)
        build a new body object instance with the given data as immutable inner data
        Parameters:
        data - the data is internally converted into a String using the provided JsonMapper
        jsonMapper - the custom JsonMapper used for the Object to String conversion
        Returns:
        the Body instance