MinimalSizeTweetFilter.java

package kafka_tweetoscope.tweetsFilter;

import com.twitter.clientlib.model.Tweet;

/**
 * Minamal Tweet Size filter : the Tweet must have a minimal length
 * 
 * @author Abel Capitant
 *
 */
public class MinimalSizeTweetFilter extends AbstractTweetFilter {
	protected int n;

	public MinimalSizeTweetFilter(String inputTopic, String outputTopic, String bootstrapServer,int n) {
		super(inputTopic, outputTopic, bootstrapServer);
		this.n = n;
	}

	@Override
	protected boolean filterTweet(Tweet tweet) {
		return tweet.getText().length() >= n;
	}

}