org.springframework.social.twitter.api
Class FilterStreamParameters

java.lang.Object
  extended by org.springframework.social.twitter.api.FilterStreamParameters

public class FilterStreamParameters
extends Object

Defines the parameters of a filtered stream. You must set at least one of track, follow, or locations.


Field Summary
protected  StringBuffer follow
           
protected  StringBuffer locations
           
protected  boolean stallWarnings
           
protected  StringBuffer track
           
 
Constructor Summary
FilterStreamParameters()
           
 
Method Summary
 org.springframework.social.twitter.api.AbstractStreamParameters addLocation(float west, float south, float east, float north)
          Add a location to the filter Does not replace any existing locations in the filter.
 FilterStreamParameters follow(long follow)
          Add a user to follow in the stream.
 String getFollowParameterValue()
           
 String getLocationsParameterValue()
           
 String getTrackParameterValue()
           
 boolean isValid()
          Whether or not at least one of track, follow, or locations has values.
 org.springframework.social.twitter.api.AbstractStreamParameters stallWarnings(boolean stallWarnings)
           
 MultiValueMap<String,String> toParameterMap()
           
 org.springframework.social.twitter.api.AbstractStreamParameters track(String track)
          Add tracking keywords to the filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

follow

protected StringBuffer follow

track

protected StringBuffer track

locations

protected StringBuffer locations

stallWarnings

protected boolean stallWarnings
Constructor Detail

FilterStreamParameters

public FilterStreamParameters()
Method Detail

follow

public FilterStreamParameters follow(long follow)
Add a user to follow in the stream. Does not replace any existing follows in the filter.

Parameters:
follow - the Twitter user ID of a user to follow in the stream.
Returns:
this FilterStreamParameters for building up filter parameters.

getFollowParameterValue

public String getFollowParameterValue()
Returns:
the follow parameters as they'll be sent in the streaming request.

isValid

public boolean isValid()
Whether or not at least one of track, follow, or locations has values.

Returns:
true if the minimum requirements are met.

toParameterMap

public MultiValueMap<String,String> toParameterMap()

track

public org.springframework.social.twitter.api.AbstractStreamParameters track(String track)
Add tracking keywords to the filter. Does not replace any existing tracking keywords in the filter.

Parameters:
track - the keywords to track.
Returns:
this StreamFilter for building up filter parameters.

addLocation

public org.springframework.social.twitter.api.AbstractStreamParameters addLocation(float west,
                                                                                   float south,
                                                                                   float east,
                                                                                   float north)
Add a location to the filter Does not replace any existing locations in the filter.

Parameters:
west - the longitude of the western side of the location's bounding box.
south - the latitude of the southern side of the location's bounding box.
east - the longitude of the eastern side of the location's bounding box.
north - the latitude of the northern side of the location's bounding box.
Returns:
this StreamFilter for building up filter parameters.

stallWarnings

public org.springframework.social.twitter.api.AbstractStreamParameters stallWarnings(boolean stallWarnings)

getTrackParameterValue

public String getTrackParameterValue()
Returns:
the track parameters as they'll be sent in the streaming request.

getLocationsParameterValue

public String getLocationsParameterValue()
Returns:
the locations parameters as they'll be sent in the streaming request.