Package org.ctan.site.services.postings
Class Posting
java.lang.Object
org.ctan.site.services.postings.Posting
- All Implemented Interfaces:
Comparable<Posting>
This class represents a mail from a mailing list. This consists of some
header fields and the mail body.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
This method adds a package to the list of associated packages.int
Getter for a header field.This is the getter forbody
in a HTMLified form.The methodgetDateFormatted
returns the date in the form of a day.getDay()
The methodgetDay
returns the date in the form of a day.The methodgetFromEmail
returns the from email.The methodgetFromName
returns the from name.getId()
This is the getter forid
.getOrDefault
(Object key, String defaultValue) Getter for a header field with a fall-back value.This is the getter forsubject
.Setter for a header field.void
Copies all of the mappings from the specified map to this map.void
This is the setter forbody
.toString()
-
Constructor Details
-
Posting
This is the constructor forPosting
.- Parameters:
from
- the from line
-
-
Method Details
-
addPkg
This method adds a package to the list of associated packages.- Parameters:
p
- the package key
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Posting>
- See Also:
-
get
Getter for a header field.- Parameters:
key
- the name of the header- Returns:
- the value of the header or
null
for none
-
getBodyAsHtml
This is the getter forbody
in a HTMLified form.- Returns:
- the body
-
getDateFormatted
The methodgetDateFormatted
returns the date in the form of a day.- Returns:
- the date as day
-
getDay
The methodgetDay
returns the date in the form of a day.- Returns:
- the date as day
-
getFromEmail
The methodgetFromEmail
returns the from email.- Returns:
- the from email
-
getFromName
The methodgetFromName
returns the from name.- Returns:
- the from name
-
getId
This is the getter forid
.- Returns:
- the body
-
getOrDefault
Getter for a header field with a fall-back value.- Parameters:
key
- the keydefaultValue
- the fall-back value- Returns:
- the header field or the fall-back if the header is undefined
-
getSubject
This is the getter forsubject
.- Returns:
- the subject
-
put
Setter for a header field.- Parameters:
key
- the keyvalue
- the value- Returns:
- the value
-
putAll
Copies all of the mappings from the specified map to this map.- Parameters:
m
- the values- See Also:
-
setBody
This is the setter forbody
.- Parameters:
body
- the new value for body
-
toString
-