导航菜单

页面标题

页面副标题

bbinstant v6.24.0 - CapsExtension.java 源代码

正在查看: bbinstant v6.24.0 应用的 CapsExtension.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package org.jivesoftware.smackx.caps.packet;

import org.jivesoftware.smack.packet.ExtensionElement;
import org.jivesoftware.smack.packet.Stanza;
import org.jivesoftware.smack.roster.packet.RosterVer;
import org.jivesoftware.smack.util.XmlStringBuilder;
import org.jivesoftware.smackx.iot.data.element.NodeElement;

public class CapsExtension implements ExtensionElement {
    public static final String ELEMENT = "c";
    public static final String NAMESPACE = "http://jabber.org/protocol/caps";
    private final String hash;
    private final String node;
    private final String ver;

    public CapsExtension(String str, String str2, String str3) {
        this.node = str;
        this.ver = str2;
        this.hash = str3;
    }

    public static CapsExtension from(Stanza stanza) {
        return (CapsExtension) stanza.getExtension("c", "http://jabber.org/protocol/caps");
    }

    @Override
    public String getElementName() {
        return "c";
    }

    public String getHash() {
        return this.hash;
    }

    @Override
    public String getNamespace() {
        return "http://jabber.org/protocol/caps";
    }

    public String getNode() {
        return this.node;
    }

    public String getVer() {
        return this.ver;
    }

    @Override
    public XmlStringBuilder toXML() {
        XmlStringBuilder xmlStringBuilder = new XmlStringBuilder((ExtensionElement) this);
        xmlStringBuilder.attribute("hash", this.hash).attribute(NodeElement.ELEMENT, this.node).attribute(RosterVer.ELEMENT, this.ver);
        xmlStringBuilder.closeEmptyElement();
        return xmlStringBuilder;
    }
}