public final class DiscussionHistory
extends java.lang.Object
The discussion history for a multi-user chat room, which can be requested when entering a room.
// To request discussion history for max. 65000 characters
DiscussionHistory history = DiscussionHistory.forMaxChars(65000);
// To request discussion history for max. the last 25 messages
DiscussionHistory history = DiscussionHistory.forMaxMessages(25);
// To request discussion history for the last 180 seconds
DiscussionHistory history = DiscussionHistory.forSeconds(180);
// To request no discussion history at all
DiscussionHistory history = DiscussionHistory.none();
This class is immutable.
Modifier and Type | Method and Description |
---|---|
static DiscussionHistory |
forMaxChars(int maxChars)
Limit the total number of characters in the history to “X” (where the character count is the characters of the complete XML stanzas, not only their XML character data).
|
static DiscussionHistory |
forMaxMessages(int maxMessages)
Limit the total number of messages in the history to “X”.
|
static DiscussionHistory |
forSeconds(int seconds)
Send only the messages received in the last “X” seconds.
|
static DiscussionHistory |
none()
Send no history.
|
static DiscussionHistory |
since(java.time.Instant date)
Send only the messages received since the date.
|
java.lang.String |
toString() |
public static DiscussionHistory forMaxChars(int maxChars)
Limit the total number of characters in the history to “X” (where the character count is the characters of the complete XML stanzas, not only their XML character data).
maxChars
- The maximal character count.public static DiscussionHistory forMaxMessages(int maxMessages)
Limit the total number of messages in the history to “X”.
maxMessages
- The maximal number of messages.public static DiscussionHistory forSeconds(int seconds)
Send only the messages received in the last “X” seconds.
seconds
- The seconds.public static DiscussionHistory since(java.time.Instant date)
Send only the messages received since the date.
date
- The date.public static DiscussionHistory none()
Send no history.
public final java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2014–2019 XMPP.rocks. All rights reserved.