twitter4j.internal.http
Class HttpParameter

java.lang.Object
  extended by twitter4j.internal.http.HttpParameter
All Implemented Interfaces:
Serializable, Comparable

public final class HttpParameter
extends Object
implements Comparable, Serializable

A data class representing HTTP Post parameter

Author:
Yusuke Yamamoto - yusuke at mac.com
See Also:
Serialized Form

Constructor Summary
HttpParameter(String name, boolean value)
           
HttpParameter(String name, double value)
           
HttpParameter(String name, File file)
           
HttpParameter(String name, int value)
           
HttpParameter(String name, long value)
           
HttpParameter(String name, String value)
           
HttpParameter(String name, String fileName, InputStream fileBody)
           
 
Method Summary
 int compareTo(Object o)
           
static boolean containsFile(HttpParameter[] params)
           
static String encode(String value)
           
static String encodeParameters(HttpParameter[] httpParams)
           
 boolean equals(Object o)
           
 String getContentType()
           
 File getFile()
           
 InputStream getFileBody()
           
 String getName()
           
static HttpParameter[] getParameterArray(String name, int value)
           
static HttpParameter[] getParameterArray(String name1, int value1, String name2, int value2)
           
static HttpParameter[] getParameterArray(String name, String value)
           
static HttpParameter[] getParameterArray(String name1, String value1, String name2, String value2)
           
 String getValue()
           
 boolean hasFileBody()
           
 int hashCode()
           
 boolean isFile()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HttpParameter

public HttpParameter(String name,
                     String value)

HttpParameter

public HttpParameter(String name,
                     File file)

HttpParameter

public HttpParameter(String name,
                     String fileName,
                     InputStream fileBody)

HttpParameter

public HttpParameter(String name,
                     int value)

HttpParameter

public HttpParameter(String name,
                     long value)

HttpParameter

public HttpParameter(String name,
                     double value)

HttpParameter

public HttpParameter(String name,
                     boolean value)
Method Detail

getName

public String getName()

getValue

public String getValue()

getFile

public File getFile()

getFileBody

public InputStream getFileBody()

isFile

public boolean isFile()

hasFileBody

public boolean hasFileBody()

getContentType

public String getContentType()
Returns:
content-type

equals

public boolean equals(Object o)
Overrides:
equals in class Object

containsFile

public static boolean containsFile(HttpParameter[] params)

getParameterArray

public static HttpParameter[] getParameterArray(String name,
                                                String value)

getParameterArray

public static HttpParameter[] getParameterArray(String name,
                                                int value)

getParameterArray

public static HttpParameter[] getParameterArray(String name1,
                                                String value1,
                                                String name2,
                                                String value2)

getParameterArray

public static HttpParameter[] getParameterArray(String name1,
                                                int value1,
                                                String name2,
                                                int value2)

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable

encodeParameters

public static String encodeParameters(HttpParameter[] httpParams)

encode

public static String encode(String value)
Parameters:
value - string to be encoded
Returns:
encoded string
See Also:
OAuth / TestCases, Space encoding - OAuth | Google Groups, RFC 3986 - Uniform Resource Identifier (URI): Generic Syntax - 2.1. Percent-Encoding


Copyright © 2012. All Rights Reserved.