Class NewsAttributes
- java.lang.Object
-
- crawlercommons.sitemaps.extension.ExtensionMetadata
-
- crawlercommons.sitemaps.extension.NewsAttributes
-
- All Implemented Interfaces:
Serializable
public class NewsAttributes extends ExtensionMetadata
Data model for Google's extension to the sitemap protocol regarding news indexing, as per http ://www.google.com/schemas/sitemap-news/0.9.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NewsAttributes.AccessOption
static class
NewsAttributes.NewsGenre
-
Field Summary
Fields Modifier and Type Field Description static String
ACCESS
Accessibility of the news article.static String
GENRES
static String
KEYWORDS
static String
LANGUAGE
Language of the news publication in which the article appears.static String
NAME
Name of the news publication in which the article appears.static String
PUBLICATION_DATE
static String
STOCK_TICKERS
static String
TITLE
Title of the news article.
-
Constructor Summary
Constructors Constructor Description NewsAttributes()
NewsAttributes(String name, String language, ZonedDateTime publicationDate, String title)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,String[]>
asMap()
boolean
equals(Object other)
NewsAttributes.AccessOption
getAccess()
NewsAttributes.NewsGenre[]
getGenres()
String[]
getKeywords()
String
getLanguage()
String
getName()
Date
getPublicationDate()
ZonedDateTime
getPublicationDateTime()
String[]
getStockTickers()
String
getTitle()
boolean
isValid()
Validate extension metadata.void
setAccess(String access)
void
setGenres(NewsAttributes.NewsGenre[] genres)
void
setKeywords(String[] keywords)
void
setLanguage(String language)
void
setName(String name)
void
setPublicationDate(ZonedDateTime publicationDate)
void
setStockTickers(String[] stockTickers)
void
setTitle(String title)
String
toString()
-
Methods inherited from class crawlercommons.sitemaps.extension.ExtensionMetadata
urlEquals
-
-
-
-
Field Detail
-
NAME
public static final String NAME
Name of the news publication in which the article appears.- See Also:
- Constant Field Values
-
LANGUAGE
public static final String LANGUAGE
Language of the news publication in which the article appears.- See Also:
- Constant Field Values
-
GENRES
public static final String GENRES
- See Also:
- Constant Field Values
-
PUBLICATION_DATE
public static final String PUBLICATION_DATE
- See Also:
- Constant Field Values
-
TITLE
public static final String TITLE
Title of the news article.- See Also:
- Constant Field Values
-
ACCESS
public static final String ACCESS
Accessibility of the news article.- See Also:
- Constant Field Values
-
KEYWORDS
public static final String KEYWORDS
- See Also:
- Constant Field Values
-
STOCK_TICKERS
public static final String STOCK_TICKERS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
NewsAttributes
public NewsAttributes()
-
NewsAttributes
public NewsAttributes(String name, String language, ZonedDateTime publicationDate, String title)
-
-
Method Detail
-
getName
public String getName()
- Returns:
- name of the news publication
-
setName
public void setName(String name)
-
getLanguage
public String getLanguage()
- Returns:
- language of the news publication
-
setLanguage
public void setLanguage(String language)
-
getGenres
public NewsAttributes.NewsGenre[] getGenres()
-
setGenres
public void setGenres(NewsAttributes.NewsGenre[] genres)
-
getPublicationDate
public Date getPublicationDate()
-
getPublicationDateTime
public ZonedDateTime getPublicationDateTime()
-
setPublicationDate
public void setPublicationDate(ZonedDateTime publicationDate)
-
getTitle
public String getTitle()
-
setTitle
public void setTitle(String title)
-
getKeywords
public String[] getKeywords()
-
setKeywords
public void setKeywords(String[] keywords)
-
getStockTickers
public String[] getStockTickers()
-
setStockTickers
public void setStockTickers(String[] stockTickers)
-
getAccess
public NewsAttributes.AccessOption getAccess()
-
setAccess
public void setAccess(String access)
-
equals
public boolean equals(Object other)
- Specified by:
equals
in classExtensionMetadata
-
isValid
public boolean isValid()
Description copied from class:ExtensionMetadata
Validate extension metadata. Extensions should override this method in order to validate the extension-specific set of metadata attributes.- Overrides:
isValid
in classExtensionMetadata
- Returns:
- true if all required extension attributes are present and attributes are valid.
-
asMap
public Map<String,String[]> asMap()
- Specified by:
asMap
in classExtensionMetadata
-
-