Class ContentElement.Builder
java.lang.Object
org.jivesoftware.smackx.stanza_content_encryption.element.ContentElement.Builder
- Enclosing class:
- ContentElement
-
Method Summary
Modifier and TypeMethodDescriptionaddFurtherAffixElement
(AffixElement customAffixElement) Add an additional, SCE profile specific affix element.addPayloadItem
(XmlElement payloadItem) Add a payload item as child element of the payload element.addTo
(ToAffixElement to) Add an affix element of type 'to' which addresses one recipient.Add an affix element of type 'to' which addresses one recipient.build()
Construct a content element from this builder.setFrom
(FromAffixElement from) Set the senders jid as a 'from' affix element.Set the senders jid as a 'from' affix element.Set some random length random content padding.setRandomPadding
(String padding) Set the given string as padding.Set a padding affix element.setTimestamp
(Date date) Set the given date as a 'time' affix element.setTimestamp
(TimestampAffixElement timestamp) Set the timestamp of the message as a 'time' affix element.
-
Method Details
-
addTo
Add an affix element of type 'to' which addresses one recipient. The jid in the 'to' element SHOULD be a bare jid.- Parameters:
jid
- jid- Returns:
- builder
-
addTo
Add an affix element of type 'to' which addresses one recipient.- Parameters:
to
- affix element- Returns:
- builder
-
setFrom
Set the senders jid as a 'from' affix element.- Parameters:
jid
- jid of the sender- Returns:
- builder
-
setFrom
Set the senders jid as a 'from' affix element.- Parameters:
from
- affix element- Returns:
- builder
-
setTimestamp
Set the given date as a 'time' affix element.- Parameters:
date
- timestamp as date- Returns:
- builder
-
setTimestamp
Set the timestamp of the message as a 'time' affix element.- Parameters:
timestamp
- timestamp affix element- Returns:
- builder
-
setRandomPadding
Set some random length random content padding.- Returns:
- builder
-
setRandomPadding
Set the given string as padding. The padding should be of length between 1 and 200 characters.- Parameters:
padding
- padding string- Returns:
- builder
-
setRandomPadding
Set a padding affix element.- Parameters:
padding
- affix element- Returns:
- builder
-
addFurtherAffixElement
Add an additional, SCE profile specific affix element.- Parameters:
customAffixElement
- additional affix element- Returns:
- builder
-
addPayloadItem
Add a payload item as child element of the payload element. There are some items that are not allowed as payload. Adding those will throw an exception.- Parameters:
payloadItem
- extension element- Returns:
- builder
- Throws:
IllegalArgumentException
- in case an extension element from the blacklist is added.- See Also:
-
build
Construct a content element from this builder.- Returns:
- content element
-