public final class Query extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
Query.ResultType |
static class |
Query.Unit |
Modifier and Type | Field and Description |
---|---|
static Query.Unit |
KILOMETERS |
static Query.Unit |
MILES |
static Query.ResultType |
MIXED
mixed: Include both popular and real time results in the response.
|
static Query.ResultType |
POPULAR
popular: return only the most popular results in the response.
|
static Query.ResultType |
RECENT
recent: return only the most recent results in the response
|
Modifier and Type | Method and Description |
---|---|
Query |
count(int count)
sets the number of tweets to return per page, up to a max of 100
|
boolean |
equals(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,
String unit)
Deprecated.
|
int |
getCount()
Returns the number of tweets to return per page, up to a max of 100
|
String |
getGeocode()
Returns the specified geocode
|
String |
getLang()
Returns the 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.
|
String |
getQuery()
Returns the specified query
|
Query.ResultType |
getResultType()
Returns resultType
|
String |
getSince()
Returns tweets with since the given date.
|
long |
getSinceId()
returns sinceId
|
String |
getUntil()
Returns until
|
int |
hashCode() |
Query |
lang(String lang)
restricts tweets to the given language, given by an ISO 639-1 code
|
Query |
locale(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.
|
Query |
query(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,
String unit)
Deprecated.
|
void |
setLang(String lang)
restricts tweets to the given language, given by an ISO 639-1 code
|
void |
setLocale(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(String query)
Sets the query string
|
void |
setResultType(Query.ResultType resultType)
Default value is Query.MIXED if parameter not specified
|
void |
setSince(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(String until)
If specified, returns tweets with generated before the given date.
|
Query |
since(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.
|
String |
toString() |
Query |
until(String until)
If specified, returns tweets with generated before the given date.
|
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
public Query()
public Query(String query)
public String getQuery()
public void setQuery(String query)
query
- the query stringpublic Query query(String query)
query
- the query stringpublic String getLang()
public void setLang(String lang)
lang
- an ISO 639-1 codepublic Query lang(String lang)
lang
- an ISO 639-1 codepublic String getLocale()
public void setLocale(String locale)
locale
- the localepublic Query locale(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 String getSince()
public void setSince(String since)
since
- sincepublic Query since(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 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, 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, String unit)
geoCode(GeoLocation, double, twitter4j.Query.Unit)
insteadlocation
- geo locationradius
- radiusunit
- Use "mi" for miles or "km" for kilometerspublic String getUntil()
public void setUntil(String until)
until
- untilpublic Query until(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
- resultTypeCopyright © 2018. All rights reserved.