正在查看: Housing v14.7.8 应用的 MUCInitialPresence.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Housing v14.7.8 应用的 MUCInitialPresence.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package org.jivesoftware.smackx.muc.packet;
import com.quickblox.users.Consts;
import java.util.Date;
import org.jivesoftware.smack.packet.ExtensionElement;
import org.jivesoftware.smack.packet.NamedElement;
import org.jivesoftware.smack.packet.Stanza;
import org.jivesoftware.smack.util.XmlStringBuilder;
import org.jxmpp.util.XmppDateTime;
public class MUCInitialPresence implements ExtensionElement {
public static final String ELEMENT = "x";
public static final String NAMESPACE = "http://jabber.org/protocol/muc";
private History history;
private String password;
public static class History implements NamedElement {
public static final String ELEMENT = "history";
private int maxChars = -1;
private int maxStanzas = -1;
private int seconds = -1;
private Date since;
@Override
public String getElementName() {
return ELEMENT;
}
public int getMaxChars() {
return this.maxChars;
}
public int getMaxStanzas() {
return this.maxStanzas;
}
public int getSeconds() {
return this.seconds;
}
public Date getSince() {
return this.since;
}
public void setMaxChars(int i) {
this.maxChars = i;
}
public void setMaxStanzas(int i) {
this.maxStanzas = i;
}
public void setSeconds(int i) {
this.seconds = i;
}
public void setSince(Date date) {
this.since = date;
}
@Override
public XmlStringBuilder toXML() {
XmlStringBuilder xmlStringBuilder = new XmlStringBuilder(this);
xmlStringBuilder.optIntAttribute("maxchars", getMaxChars());
xmlStringBuilder.optIntAttribute("maxstanzas", getMaxStanzas());
xmlStringBuilder.optIntAttribute("seconds", getSeconds());
if (getSince() != null) {
xmlStringBuilder.attribute("since", XmppDateTime.formatXEP0082Date(getSince()));
}
xmlStringBuilder.closeEmptyElement();
return xmlStringBuilder;
}
}
public static MUCInitialPresence from(Stanza stanza) {
return (MUCInitialPresence) stanza.getExtension("x", NAMESPACE);
}
@Deprecated
public static MUCInitialPresence getFrom(Stanza stanza) {
return from(stanza);
}
@Override
public String getElementName() {
return "x";
}
public History getHistory() {
return this.history;
}
@Override
public String getNamespace() {
return NAMESPACE;
}
public String getPassword() {
return this.password;
}
public void setHistory(History history) {
this.history = history;
}
public void setPassword(String str) {
this.password = str;
}
@Override
public XmlStringBuilder toXML() {
XmlStringBuilder xmlStringBuilder = new XmlStringBuilder((ExtensionElement) this);
xmlStringBuilder.rightAngleBracket();
xmlStringBuilder.optElement(Consts.PASSWORD, getPassword());
xmlStringBuilder.optElement(getHistory());
xmlStringBuilder.closeElement(this);
return xmlStringBuilder;
}
}