com.restfb
Class Parameter

java.lang.Object
  extended by com.restfb.Parameter

public final class Parameter
extends Object

Representation of a Facebook API request parameter.

Author:
Mark Allen

Field Summary
 String name
          Parameter name.
 String value
          Parameter value.
 
Method Summary
 boolean equals(Object obj)
           
 int hashCode()
           
 String toString()
           
static Parameter with(String name, Object value)
          Factory method which provides an instance with the given name and value.
static Parameter with(String name, Object value, JsonMapper jsonMapper)
          Factory method which provides an instance with the given name and value, using the provided jsonMapper to turn value into a JSON string.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

name

public final String name
Parameter name.


value

public final String value
Parameter value.

Method Detail

with

public static Parameter with(String name,
                             Object value)
Factory method which provides an instance with the given name and value.

The value parameter is often a String or primitive type like Integer, but you may pass in a List, 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 given name and value.
Throws:
IllegalArgumentException - If name or value is null or a blank string.
FacebookJsonMappingException - If an error occurs when converting value to JSON.

with

public static Parameter with(String name,
                             Object value,
                             JsonMapper jsonMapper)
Factory method which provides an instance with the given name and value, using the provided jsonMapper to turn value into a JSON string.

The value parameter is often a String or primitive type like Integer, but you may pass in a List, 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 given name and value.
Throws:
IllegalArgumentException - If name or value is null or a blank string.
FacebookJsonMappingException - If an error occurs when converting value to JSON.

equals

public boolean equals(Object obj)
Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Overrides:
hashCode in class Object
See Also:
Object.hashCode()

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()


RestFB 1.6.8. Copyright © 2010-2011 Mark Allen. All Rights Reserved.