Package com.restfb
Class Parameter
java.lang.Object
com.restfb.Parameter
Representation of a Facebook API request parameter.
- Author:
- Mark Allen
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
int
hashCode()
toString()
static Parameter
Factory method which provides an instance with the givenname
andvalue
.static Parameter
with(String name, Object value, JsonMapper jsonMapper)
Factory method which provides an instance with the givenname
andvalue
, using the providedjsonMapper
to turnvalue
into a JSON string.
-
Field Details
-
name
Parameter name. -
value
Parameter value.
-
-
Method Details
-
with
Factory method which provides an instance with the givenname
andvalue
.The
value
parameter is often aString
or primitive type likeInteger
, but you may pass in aList
,Map
, or your own @Facebook-annotated Javabean and it will be converted to JSON automatically. See the "attachment" section of the stream.publish API documentation for an example of where this is useful.- Parameters:
name
- The parameter name.value
- The parameter value.- Returns:
- A
Parameter
instance with the givenname
andvalue
. - Throws:
IllegalArgumentException
- Ifname
orvalue
isnull
or a blank string.FacebookJsonMappingException
- If an error occurs when convertingvalue
to JSON.
-
with
Factory method which provides an instance with the givenname
andvalue
, using the providedjsonMapper
to turnvalue
into a JSON string.The
value
parameter is often aString
or primitive type likeInteger
, but you may pass in aList
,Map
, or your own @Facebook-annotated Javabean and it will be converted to JSON automatically. See the "attachment" section of the stream.publish API documentation for an example of where this is useful.- Parameters:
name
- The parameter name.value
- The parameter value.jsonMapper
- The jsonMapper- Returns:
- A
Parameter
instance with the givenname
andvalue
. - Throws:
IllegalArgumentException
- Ifname
orvalue
isnull
or a blank string.FacebookJsonMappingException
- If an error occurs when convertingvalue
to JSON.
-
equals
- Overrides:
equals
in classObject
- See Also:
Object.equals(java.lang.Object)
-
hashCode
-
toString
-