Package cz.jiripinkas.jsitemapgenerator
Class WebPage
- 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 class
WebPage.ImageBuilder
static class
WebPage.RssItemBuilder
static class
WebPage.WebPageBuilder
-
Constructor Summary
Constructors Constructor Description WebPage()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description WebPage
addAlternateName(String language, String name)
WebPage
addImage(Image image)
static WebPage.WebPageBuilder
builder()
int
compareTo(WebPage o)
Compare WebPage first by priority (in descending order - higher priority is first), then by shortName (in ascending order).String
constructName()
Constructs name from dir and extension (if available)Map<String,String>
getAlternateNames()
ChangeFreq
getChangeFreq()
String
getDir()
String
getExtension()
List<Image>
getImages()
Date
getLastMod()
Double
getPriority()
String
getShortDescription()
String
getShortName()
static WebPage.ImageBuilder
imageBuilder()
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)static WebPage
of(java.util.function.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.RssItemBuilder
rssBuilder()
void
setAlternateNames(Map<String,String> alternateNames)
void
setChangeFreq(ChangeFreq changeFreq)
void
setDir(String dir)
void
setExtension(String extension)
void
setImages(List<Image> images)
void
setLastMod(Date lastMod)
void
setName(String name)
void
setPriority(Double priority)
void
setShortDescription(String shortDescription)
void
setShortName(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- Returns:
- WebPage instance
-
of
public static WebPage of(java.util.function.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- Returns:
- WebPage instance
-
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)- Returns:
- Name
-
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:
compareTo
in 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()
-
-