Package twitter4j.v1

Class GeoQuery

java.lang.Object
twitter4j.v1.GeoQuery
All Implemented Interfaces:
Serializable

public final class GeoQuery extends Object implements Serializable
Since:
Twitter4J 2.1.1
See Also:
  • Field Details

    • location

      @Nullable public final @Nullable GeoLocation location
      location
    • query

      public final String query
      query
    • ip

      @Nullable public final @Nullable String ip
      ip
    • accuracy

      @Nullable public final @Nullable String accuracy
      accuracy
    • granularity

      @Nullable public final @Nullable String granularity
      granularity
    • maxResults

      public final int maxResults
      maxResults
  • Method Details

    • ofGeoLocation

      public static GeoQuery ofGeoLocation(double latitude, double longitude)
      Creates a GeoQuery with the specified location
      Parameters:
      latitude - latitude
      longitude - longitude
      Returns:
      GeoQuery
    • geoLocation

      public GeoQuery geoLocation(double latitude, double longitude)
      Creates a GeoQuery with the specified location
      Parameters:
      latitude - latitude
      longitude - longitude
      Returns:
      GeoQuery
    • ofIP

      public static GeoQuery ofIP(String ip)
      Creates a GeoQuery with the specified IP address
      Parameters:
      ip - IP address
      Returns:
      GeoQuery
    • ip

      public GeoQuery ip(String ip)
      Parameters:
      ip - IP
      Returns:
      GeoQuery
    • ofQuery

      public static GeoQuery ofQuery(@NotNull @NotNull String query)
      Creates a GeoQuery with the specified query, ip and location
      Parameters:
      query - free-form text to match
      Returns:
      GeoQuery
    • query

      public GeoQuery query(@NotNull @NotNull String query)
      Creates a GeoQuery with the specified query, ip and location
      Parameters:
      query - free-form text to match
      Returns:
      GeoQuery
    • accuracy

      public GeoQuery accuracy(@NotNull @NotNull String accuracy)
      Sets a hint on the "region" in which to search. If a number, then this is a radius in meters, but it can also take a string that is suffixed with ft to specify feet. If this is not passed in, then it is assumed to be 0m. If coming from a device, in practice, this value is whatever accuracy the device has measuring its location (whether it be coming from a GPS, WiFi triangulation, etc.).
      Parameters:
      accuracy - a hint on the "region" in which to search.
      Returns:
      this instance
    • granularity

      public GeoQuery granularity(@NotNull @NotNull String granularity)
      Sets the minimal granularity of data to return. If this is not passed in, then neighborhood is assumed. city can also be passed.
      Parameters:
      granularity - the minimal granularity of data to return
      Returns:
      GeoQuery
    • maxResults

      public GeoQuery maxResults(int maxResults)
      Sets a hint as to the number of results to return. This does not guarantee that the number of results returned will equal max_results, but instead informs how many "nearby" results to return. Ideally, only pass in the number of places you intend to display to the user here.
      Parameters:
      maxResults - A hint as to the number of results to return.
      Returns:
      this instance
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object