public final class Query
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Class and Description |
---|---|
static class |
Query.ResultType |
static class |
Query.Unit |
Modifier and Type | Field and Description |
---|---|
private int |
count |
private java.lang.String |
geocode |
static Query.Unit |
KILOMETERS |
private java.lang.String |
lang |
private java.lang.String |
locale |
private long |
maxId |
static Query.Unit |
MILES |
static Query.ResultType |
MIXED
mixed: Include both popular and real time results in the response.
|
private java.lang.String |
nextPageQuery |
static Query.ResultType |
POPULAR
popular: return only the most popular results in the response.
|
private java.lang.String |
query |
static Query.ResultType |
RECENT
recent: return only the most recent results in the response
|
private Query.ResultType |
resultType |
private static long |
serialVersionUID |
private java.lang.String |
since |
private long |
sinceId |
private java.lang.String |
until |
private static HttpParameter |
WITH_TWITTER_USER_ID |
Modifier and Type | Method and Description |
---|---|
private void |
appendParameter(java.lang.String name,
long value,
java.util.List<HttpParameter> params) |
private void |
appendParameter(java.lang.String name,
java.lang.String value,
java.util.List<HttpParameter> params) |
(package private) HttpParameter[] |
asHttpParameterArray() |
Query |
count(int count)
sets the number of tweets to return per page, up to a max of 100
|
(package private) static Query |
createWithNextPageQuery(java.lang.String nextPageQuery) |
boolean |
equals(java.lang.Object o) |
Query |
geoCode(GeoLocation location,
double radius,
Query.Unit unit)
returns tweets by users located within a given radius of the given latitude/longitude, where the user's location is taken from their Twitter profile
|
Query |
geoCode(GeoLocation location,
double radius,
java.lang.String unit)
Deprecated.
|
int |
getCount()
Returns the number of tweets to return per page, up to a max of 100
|
java.lang.String |
getGeocode()
Returns the specified geocode
|
java.lang.String |
getLang()
Returns the lang
|
java.lang.String |
getLocale()
Returns the language of the query you are sending (only ja is currently effective).
|
long |
getMaxId()
Returns tweets with status ids less than the given id.
|
java.lang.String |
getQuery()
Returns the specified query
|
Query.ResultType |
getResultType()
Returns resultType
|
java.lang.String |
getSince()
Returns tweets with since the given date.
|
long |
getSinceId()
returns sinceId
|
java.lang.String |
getUntil()
Returns until
|
int |
hashCode() |
Query |
lang(java.lang.String lang)
restricts tweets to the given language, given by an ISO 639-1 code
|
Query |
locale(java.lang.String locale)
Specify the language of the query you are sending (only ja is currently effective).
|
Query |
maxId(long maxId)
If specified, returns tweets with status ids less than the given id.
|
(package private) java.lang.String |
nextPage() |
Query |
query(java.lang.String query)
Sets the query string
|
Query |
resultType(Query.ResultType resultType)
If specified, returns tweets included popular or real time or both in the response
|
void |
setCount(int count)
sets the number of tweets to return per page, up to a max of 100
|
void |
setGeoCode(GeoLocation location,
double radius,
Query.Unit unit)
returns tweets by users located within a given radius of the given latitude/longitude, where the user's location is taken from their Twitter profile
|
void |
setGeoCode(GeoLocation location,
double radius,
java.lang.String unit)
Deprecated.
|
void |
setLang(java.lang.String lang)
restricts tweets to the given language, given by an ISO 639-1 code
|
void |
setLocale(java.lang.String locale)
Specify the language of the query you are sending (only ja is currently effective).
|
void |
setMaxId(long maxId)
If specified, returns tweets with status ids less than the given id.
|
void |
setQuery(java.lang.String query)
Sets the query string
|
void |
setResultType(Query.ResultType resultType)
Default value is Query.MIXED if parameter not specified
|
void |
setSince(java.lang.String since)
If specified, returns tweets with since the given date.
|
void |
setSinceId(long sinceId)
returns tweets with status ids greater than the given id.
|
void |
setUntil(java.lang.String until)
If specified, returns tweets with generated before the given date.
|
Query |
since(java.lang.String since)
If specified, returns tweets with since the given date.
|
Query |
sinceId(long sinceId)
returns tweets with status ids greater than the given id.
|
java.lang.String |
toString() |
Query |
until(java.lang.String until)
If specified, returns tweets with generated before the given date.
|
private static final long serialVersionUID
private java.lang.String query
private java.lang.String lang
private java.lang.String locale
private long maxId
private int count
private java.lang.String since
private long sinceId
private java.lang.String geocode
private java.lang.String until
private Query.ResultType resultType
private java.lang.String nextPageQuery
public static final Query.Unit MILES
public static final Query.Unit KILOMETERS
public static final Query.ResultType MIXED
public static final Query.ResultType POPULAR
public static final Query.ResultType RECENT
private static final HttpParameter WITH_TWITTER_USER_ID
static Query createWithNextPageQuery(java.lang.String nextPageQuery)
public java.lang.String getQuery()
public void setQuery(java.lang.String query)
query
- the query stringpublic Query query(java.lang.String query)
query
- the query stringpublic java.lang.String getLang()
public void setLang(java.lang.String lang)
lang
- an ISO 639-1 codepublic Query lang(java.lang.String lang)
lang
- an ISO 639-1 codepublic java.lang.String getLocale()
public void setLocale(java.lang.String locale)
locale
- the localepublic Query locale(java.lang.String locale)
locale
- the localepublic long getMaxId()
public void setMaxId(long maxId)
maxId
- maxIdpublic Query maxId(long maxId)
maxId
- maxIdpublic int getCount()
public void setCount(int count)
count
- the number of tweets to return per pagepublic Query count(int count)
count
- the number of tweets to return per pagepublic java.lang.String getSince()
public void setSince(java.lang.String since)
since
- sincepublic Query since(java.lang.String since)
since
- sincepublic long getSinceId()
public void setSinceId(long sinceId)
sinceId
- returns tweets with status ids greater than the given idpublic Query sinceId(long sinceId)
sinceId
- returns tweets with status ids greater than the given idpublic java.lang.String getGeocode()
public void setGeoCode(GeoLocation location, double radius, Query.Unit unit)
location
- geo locationradius
- radiusunit
- Query.MILES or Query.KILOMETERSpublic void setGeoCode(GeoLocation location, double radius, java.lang.String unit)
setGeoCode(GeoLocation, double, twitter4j.Query.Unit)
insteadlocation
- geo locationradius
- radiusunit
- Use "mi" for miles or "km" for kilometerspublic Query geoCode(GeoLocation location, double radius, Query.Unit unit)
location
- geo locationradius
- radiusunit
- Query.MILES or Query.KILOMETERSpublic Query geoCode(GeoLocation location, double radius, java.lang.String unit)
geoCode(GeoLocation, double, twitter4j.Query.Unit)
insteadlocation
- geo locationradius
- radiusunit
- Use "mi" for miles or "km" for kilometerspublic java.lang.String getUntil()
public void setUntil(java.lang.String until)
until
- untilpublic Query until(java.lang.String until)
until
- untilpublic Query.ResultType getResultType()
public void setResultType(Query.ResultType resultType)
resultType
- Query.MIXED or Query.POPULAR or Query.RECENTpublic Query resultType(Query.ResultType resultType)
resultType
- resultTypeHttpParameter[] asHttpParameterArray()
private void appendParameter(java.lang.String name, java.lang.String value, java.util.List<HttpParameter> params)
private void appendParameter(java.lang.String name, long value, java.util.List<HttpParameter> params)
java.lang.String nextPage()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object