public class NewsFilter extends Object implements Serializable
Sample builder usage:
NewsFilter filter = NewsFilter.newBuilder()
.withSources("Business Wire")
.withSymbols("AAPL", "MSFT")
.withLimit(50)
.withTimeout(60_000L)
.build();
| Modifier and Type | Class and Description |
|---|---|
static class |
NewsFilter.Builder |
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_LIMIT
Default (and maximum) limit for the news count returned in one chunk.
|
static long |
DEFAULT_TIMEOUT
Default (and maximum) time period to wait while polling for news.
|
static NewsFilter |
EMPTY_FILTER
Empty filter with all params set by default.
|
static String |
FILTER_FEED |
static String |
FILTER_LIMIT |
static Set<String> |
FILTER_PARAMETERS
Set of all available fields for the filter.
|
static String |
FILTER_SOURCE |
static String |
FILTER_SYMBOL |
static String |
FILTER_TIMEOUT |
| Modifier | Constructor and Description |
|---|---|
protected |
NewsFilter(Map<String,Set<String>> params) |
| Modifier and Type | Method and Description |
|---|---|
NewsFilter.Builder |
builder() |
static NewsFilter |
emptyFilter() |
Set<String> |
getFeeds()
Returns set of feeds to filter on, or
null otherwise. |
int |
getLimit()
Returns maximum number of news to return.
|
Set<String> |
getParam(String name) |
Map<String,Set<String>> |
getParams()
Returns all filter parameters as a map.
|
Set<String> |
getSources()
Returns set of news sources to filter on, or
null otherwise. |
Set<String> |
getSymbols()
Returns set of instrument symbols to filter on, or
null otherwise. |
long |
getTimeout()
Sets the timeout in millis to wait while polling for news.
|
static NewsFilter |
limitFilter(int limit) |
static NewsFilter.Builder |
newBuilder() |
String |
toString() |
public static final String FILTER_FEED
getFeeds(),
Constant Field Valuespublic static final String FILTER_SOURCE
getSources(),
Constant Field Valuespublic static final String FILTER_SYMBOL
getSymbols(),
Constant Field Valuespublic static final String FILTER_LIMIT
getLimit(),
Constant Field Valuespublic static final String FILTER_TIMEOUT
getTimeout(),
Constant Field Valuespublic static final Set<String> FILTER_PARAMETERS
public static final NewsFilter EMPTY_FILTER
public static final int DEFAULT_LIMIT
public static final long DEFAULT_TIMEOUT
public static NewsFilter.Builder newBuilder()
public static NewsFilter limitFilter(int limit)
public static NewsFilter emptyFilter()
public NewsFilter.Builder builder()
public Set<String> getSources()
null otherwise.public Set<String> getSymbols()
null otherwise.public int getLimit()
public long getTimeout()
Copyright © 2021 Devexperts. All Rights Reserved.