public final class NewsOrigin extends Object implements Serializable
NewsEvents
from one or more sources.
Origin can be exact, with fixed feed and source, and can be a mask, where feed, source or both are set to '*'.
Each NewsEvent's
origin is always exact.
Origins with masks can be used as filters
for
NewsEvents
.
String representation of origin is <feed>:<source>
, where <feed>
is alphanumeric string which starts from letter and <source>
is arbitrary string
of printable characters.
When NewsOrigin
is created, empty <feed>
or <source>
is interpreted
as *
and string without :
(semicolon) is interpreted as <feed>:*
.
Empty string is special value that means "nothing".
Modifier and Type | Field and Description |
---|---|
static NewsOrigin |
ANY
NewsOrigin which matches any feed and source, *:* . |
static NewsOrigin |
NOTHING
NewsOrigin which matches with nothing. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
String |
getFeed() |
String |
getSource() |
String |
getSourcePrefix() |
int |
hashCode() |
boolean |
isEmptySourcePrefix() |
boolean |
isExact() |
boolean |
isFeedWildcard() |
boolean |
isSourcePrefixWildcard() |
boolean |
isSourceWildcard() |
boolean |
isWildcard() |
String |
toString() |
static NewsOrigin |
valueOf(NewsEvent event) |
static NewsOrigin |
valueOf(String origin) |
static NewsOrigin |
valueOf(String feed,
String sourcePrefix,
String source) |
public static final NewsOrigin ANY
NewsOrigin
which matches any feed and source, *:*
.public static final NewsOrigin NOTHING
NewsOrigin
which matches with nothing.public static NewsOrigin valueOf(String origin)
public static NewsOrigin valueOf(String feed, String sourcePrefix, String source)
public static NewsOrigin valueOf(NewsEvent event)
public String getFeed()
public String getSource()
public String getSourcePrefix()
public boolean isFeedWildcard()
public boolean isSourceWildcard()
public boolean isSourcePrefixWildcard()
public boolean isWildcard()
public boolean isExact()
public boolean isEmptySourcePrefix()
Copyright © 2024 Devexperts. All rights reserved.