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

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


package org.jivesoftware.smackx.address.packet;

import java.util.ArrayList;
import java.util.List;
import org.jivesoftware.smack.packet.ExtensionElement;
import org.jivesoftware.smack.packet.NamedElement;
import org.jivesoftware.smack.util.XmlStringBuilder;
public class MultipleAddresses implements ExtensionElement {
    public static final String ELEMENT = "addresses";
    public static final String NAMESPACE = "http://jabber.org/protocol/address";
    public final List<Address> addresses = new ArrayList();

    public static final class Address implements NamedElement {
        public static final String ELEMENT = "address";
        public boolean delivered;
        public String description;
        public xw3 jid;
        public String node;
        public final Type type;
        public String uri;

        public void setDelivered(boolean z) {
            this.delivered = z;
        }

        public void setDescription(String str) {
            this.description = str;
        }

        public void setJid(xw3 xw3Var) {
            this.jid = xw3Var;
        }

        public void setNode(String str) {
            this.node = str;
        }

        public void setUri(String str) {
            this.uri = str;
        }

        public String getDescription() {
            return this.description;
        }

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

        public xw3 getJid() {
            return this.jid;
        }

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

        public Type getType() {
            return this.type;
        }

        public String getUri() {
            return this.uri;
        }

        public boolean isDelivered() {
            return this.delivered;
        }

        public Address(Type type) {
            this.type = type;
        }

        @Override
        public XmlStringBuilder toXML(String str) {
            XmlStringBuilder xmlStringBuilder = new XmlStringBuilder();
            xmlStringBuilder.halfOpenElement(this).attribute("type", this.type);
            xmlStringBuilder.optAttribute("jid", this.jid);
            xmlStringBuilder.optAttribute("node", this.node);
            xmlStringBuilder.optAttribute("desc", this.description);
            String str2 = this.description;
            if (str2 != null && str2.trim().length() > 0) {
                xmlStringBuilder.append((CharSequence) " desc=\"");
                xmlStringBuilder.append((CharSequence) this.description).append('\"');
            }
            xmlStringBuilder.optBooleanAttribute(wv1.B, this.delivered);
            xmlStringBuilder.optAttribute("uri", this.uri);
            xmlStringBuilder.closeEmptyElement();
            return xmlStringBuilder;
        }
    }

    public enum Type {
        bcc,
        cc,
        noreply,
        replyroom,
        replyto,
        to,
        ofrom
    }

    public void addAddress(Type type, xw3 xw3Var, String str, String str2, boolean z, String str3) {
        Address address = new Address(type);
        address.setJid(xw3Var);
        address.setNode(str);
        address.setDescription(str2);
        address.setDelivered(z);
        address.setUri(str3);
        this.addresses.add(address);
    }

    public List<Address> getAddressesOfType(Type type) {
        ArrayList arrayList = new ArrayList(this.addresses.size());
        for (Address address : this.addresses) {
            if (address.getType().equals(type)) {
                arrayList.add(address);
            }
        }
        return arrayList;
    }

    @Override
    public String getElementName() {
        return ELEMENT;
    }

    @Override
    public String getNamespace() {
        return NAMESPACE;
    }

    public void setNoReply() {
        this.addresses.add(new Address(Type.noreply));
    }

    @Override
    public XmlStringBuilder toXML(String str) {
        XmlStringBuilder xmlStringBuilder = new XmlStringBuilder((ExtensionElement) this);
        xmlStringBuilder.rightAngleBracket();
        for (Address address : this.addresses) {
            xmlStringBuilder.append(address.toXML((String) null));
        }
        xmlStringBuilder.closeElement(this);
        return xmlStringBuilder;
    }
}