思特奇智慧酒店云平台 v0.0.5版本的 MD5 值为:dedb172bb322639d79d7e0e26262fb5c

以下内容为反编译后的 MUCInitialPresence.java 源代码,内容仅作参考


package org.jivesoftware.smackx.muc.packet;

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.jivesoftware.smackx.last_interaction.element.IdleElement;
public class MUCInitialPresence implements ExtensionElement {
    public static final String ELEMENT = "x";
    public static final String NAMESPACE = "http://jabber.org/protocol/muc";
    public History history;
    public String password;

    public static class History implements NamedElement {
        public static final String ELEMENT = "history";
        public int maxChars;
        public int maxStanzas;
        public int seconds;
        public Date since;

        @Deprecated
        public History() {
            this.maxChars = -1;
            this.maxStanzas = -1;
            this.seconds = -1;
        }

        @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;
        }

        @Deprecated
        public void setMaxChars(int i) {
            this.maxChars = i;
        }

        @Deprecated
        public void setMaxStanzas(int i) {
            this.maxStanzas = i;
        }

        @Deprecated
        public void setSeconds(int i) {
            this.seconds = i;
        }

        @Deprecated
        public void setSince(Date date) {
            this.since = date;
        }

        @Override
        public XmlStringBuilder toXML(String str) {
            XmlStringBuilder xmlStringBuilder = new XmlStringBuilder(this);
            xmlStringBuilder.optIntAttribute("maxchars", getMaxChars());
            xmlStringBuilder.optIntAttribute("maxstanzas", getMaxStanzas());
            xmlStringBuilder.optIntAttribute("seconds", getSeconds());
            if (getSince() != null) {
                xmlStringBuilder.attribute(IdleElement.ATTR_SINCE, px3.a(getSince()));
            }
            xmlStringBuilder.closeEmptyElement();
            return xmlStringBuilder;
        }

        public History(int i, int i2, int i3, Date date) {
            if (i < 0 && i2 < 0 && i3 < 0 && date == null) {
                throw new IllegalArgumentException();
            }
            this.maxChars = i;
            this.maxStanzas = i2;
            this.seconds = i3;
            this.since = date;
        }
    }

    @Deprecated
    public MUCInitialPresence() {
    }

    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;
    }

    @Deprecated
    public void setHistory(History history) {
        this.history = history;
    }

    @Deprecated
    public void setPassword(String str) {
        this.password = str;
    }

    public MUCInitialPresence(String str, int i, int i2, int i3, Date date) {
        this.password = str;
        if (i <= -1 && i2 <= -1 && i3 <= -1 && date == null) {
            this.history = null;
        } else {
            this.history = new History(i, i2, i3, date);
        }
    }

    @Override
    public XmlStringBuilder toXML(String str) {
        XmlStringBuilder xmlStringBuilder = new XmlStringBuilder((ExtensionElement) this);
        xmlStringBuilder.rightAngleBracket();
        xmlStringBuilder.optElement("password", getPassword());
        xmlStringBuilder.optElement(getHistory());
        xmlStringBuilder.closeElement(this);
        return xmlStringBuilder;
    }
}