Package twitter4j.v1

Class Query

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

public final class Query extends Object implements Serializable
A data class represents search query.
An instance of this class is NOT thread safe.
Instances can be shared across threads, but should not be mutated while a search is ongoing.
See Also:
  • Field Details

    • query

      @NotNull public final @NotNull String query
      query
    • lang

      public final String lang
      lang
    • locale

      public final String locale
      locale
    • maxId

      public final long maxId
      maxId
    • count

      public final int count
      count
    • since

      @Nullable public final @Nullable String since
      since
    • sinceId

      public final long sinceId
      sinceId
    • geocode

      @Nullable public final @Nullable String geocode
      geocode
    • until

      @Nullable public final @Nullable String until
      until
    • resultType

      @Nullable public final @Nullable Query.ResultType resultType
      result type
    • nextPageQuery

      @Nullable public final @Nullable String nextPageQuery
      next page query
    • MILES

      public static final Query.Unit MILES
      miles
    • KILOMETERS

      public static final Query.Unit KILOMETERS
      kilo meters
    • MIXED

      public static final Query.ResultType MIXED
      mixed: Include both popular and real time results in the response.
    • RECENT

      public static final Query.ResultType RECENT
      recent: return only the most recent results in the response
  • Method Details

    • lang

      @NotNull public @NotNull Query lang(@NotNull @NotNull String lang)
      creates a new Query instance with the specified lang
      Parameters:
      lang - lang
      Returns:
      new Query instance
    • locale

      @NotNull public @NotNull Query locale(@NotNull @NotNull String locale)
      creates a new Query instance with the specified locale
      Parameters:
      locale - locale
      Returns:
      new Query instance
    • maxId

      @NotNull public @NotNull Query maxId(long maxId)
      creates a new Query instance with the specified maxId
      Parameters:
      maxId - maxId
      Returns:
      new Query instance
    • count

      @NotNull public @NotNull Query count(int count)
      creates a new Query instance with the specified count
      Parameters:
      count - count
      Returns:
      new Query instance
    • since

      @NotNull public @NotNull Query since(@NotNull @NotNull String since)
      creates a new Query instance with the specified since
      Parameters:
      since - since
      Returns:
      new Query instance
    • sinceId

      @NotNull public @NotNull Query sinceId(long sinceId)
      creates a new Query instance with the specified sinceId
      Parameters:
      sinceId - sinceId
      Returns:
      new Query instance
    • geoCode

      @NotNull public @NotNull Query geoCode(@NotNull @NotNull GeoLocation location, double radius, Query.Unit unit)
      creates a new Query instance with the specified geolocation
      Parameters:
      location - geolocation
      radius - radius
      unit - unit
      Returns:
      new Query instance
    • until

      @NotNull public @NotNull Query until(@NotNull @NotNull String until)
      creates a new Query instance with the specified until
      Parameters:
      until - until
      Returns:
      new Query instance
    • resultType

      @NotNull public @NotNull Query resultType(@NotNull @NotNull Query.ResultType resultType)
      creates a new Query instance with the specified result type
      Parameters:
      resultType - result type
      Returns:
      new Query instance
    • of

      @NotNull public static @NotNull Query of(@NotNull @NotNull String query)
      Parameters:
      query - query
      Returns:
      Query
    • 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