- java.lang.Object
-
- cz.jiripinkas.jsitemapgenerator.WebPage
-
- All Implemented Interfaces:
Comparable<WebPage>
public class WebPage extends Object implements Comparable<WebPage>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWebPage.ImageBuilderstatic classWebPage.RssItemBuilderstatic classWebPage.WebPageBuilder
-
Constructor Summary
Constructors Constructor Description WebPage()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description WebPageaddAlternateName(String language, String name)WebPageaddImage(Image image)static WebPage.WebPageBuilderbuilder()intcompareTo(WebPage o)Compare WebPage first by priority (in descending order - higher priority is first), then by shortName (in ascending order).StringconstructName()Constructs name from dir and extension (if available), used in SitemapGeneratorsStringconstructShortName()Constructs shortName from dir and extension (if available), used in RssGeneratorbooleanequals(Object o)Map<String,String>getAlternateNames()ChangeFreqgetChangeFreq()StringgetDir()StringgetExtension()List<Image>getImages()DategetLastMod()StringgetName()DoublegetPriority()StringgetShortDescription()StringgetShortName()inthashCode()static WebPage.ImageBuilderimageBuilder()static WebPageof(String name)Method for creating WebPage only with name (this can be useful for really simple sitemaps or with combination of default settings set on SitemapGenerator)static WebPageof(Supplier<String> nameSupplier)Method for creating WebPage only with name (this can be useful for really simple sitemaps or with combination of default settings set on SitemapGenerator)static WebPage.RssItemBuilderrssBuilder()voidsetAlternateNames(Map<String,String> alternateNames)voidsetChangeFreq(ChangeFreq changeFreq)voidsetDir(String dir)voidsetExtension(String extension)voidsetImages(List<Image> images)voidsetLastMod(Date lastMod)voidsetName(String name)voidsetPriority(Double priority)voidsetShortDescription(String shortDescription)voidsetShortName(String shortName)
-
-
-
Method Detail
-
of
public static WebPage of(String name)
Method for creating WebPage only with name (this can be useful for really simple sitemaps or with combination of default settings set on SitemapGenerator)- Parameters:
name- Name (cannot be null)- Returns:
- WebPage instance
- Throws:
NullPointerException- When name is null
-
of
public static WebPage of(Supplier<String> nameSupplier)
Method for creating WebPage only with name (this can be useful for really simple sitemaps or with combination of default settings set on SitemapGenerator)- Parameters:
nameSupplier- Name supplier (cannot return null!!!)- Returns:
- WebPage instance
- Throws:
NullPointerException- When nameSupplier or nameSupplier.get() returns null
-
getShortName
public String getShortName()
-
setShortName
public void setShortName(String shortName)
-
getShortDescription
public String getShortDescription()
-
setShortDescription
public void setShortDescription(String shortDescription)
-
setName
public void setName(String name)
-
setLastMod
public void setLastMod(Date lastMod)
-
setChangeFreq
public void setChangeFreq(ChangeFreq changeFreq)
-
setPriority
public void setPriority(Double priority)
-
constructName
public String constructName()
Constructs name from dir and extension (if available), used in SitemapGenerators- Returns:
- Name
-
constructShortName
public String constructShortName()
Constructs shortName from dir and extension (if available), used in RssGenerator- Returns:
- Name
-
getName
public String getName()
-
getLastMod
public Date getLastMod()
-
getChangeFreq
public ChangeFreq getChangeFreq()
-
getPriority
public Double getPriority()
-
getDir
public String getDir()
-
setDir
public void setDir(String dir)
-
getExtension
public String getExtension()
-
setExtension
public void setExtension(String extension)
-
compareTo
public int compareTo(WebPage o)
Compare WebPage first by priority (in descending order - higher priority is first), then by shortName (in ascending order). Priority and / or shortName can be null. WebPages with null priority are at the end.- Specified by:
compareToin interfaceComparable<WebPage>- Parameters:
o- Other WebPage- Returns:
- -1, 0, 1
-
builder
public static WebPage.WebPageBuilder builder()
-
rssBuilder
public static WebPage.RssItemBuilder rssBuilder()
-
imageBuilder
public static WebPage.ImageBuilder imageBuilder()
-
-