mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-09 09:09:38 +02:00
Remove deprecated methods from Stanza class
This commit is contained in:
parent
f0300dc906
commit
30bbdf9fdb
3 changed files with 37 additions and 82 deletions
|
@ -31,8 +31,6 @@ import org.jivesoftware.smack.util.PacketUtil;
|
|||
import org.jivesoftware.smack.util.XmlStringBuilder;
|
||||
|
||||
import org.jxmpp.jid.Jid;
|
||||
import org.jxmpp.jid.impl.JidCreate;
|
||||
import org.jxmpp.stringprep.XmppStringprepException;
|
||||
|
||||
/**
|
||||
* Base class for XMPP Stanzas, which are called Stanza in older versions of Smack (i.e. < 4.1).
|
||||
|
@ -47,6 +45,7 @@ import org.jxmpp.stringprep.XmppStringprepException;
|
|||
* </p>
|
||||
*
|
||||
* @author Matt Tucker
|
||||
* @author Florian Schmaus
|
||||
* @see <a href="http://xmpp.org/rfcs/rfc6120.html#stanzas">RFC 6120 § 8. XML Stanzas</a>
|
||||
*/
|
||||
public abstract class Stanza implements TopLevelStreamElement {
|
||||
|
@ -109,16 +108,6 @@ public abstract class Stanza implements TopLevelStreamElement {
|
|||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Stanza ID.
|
||||
* @return the stanza id.
|
||||
* @deprecated use {@link #getStanzaId()} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public String getPacketID() {
|
||||
return getStanzaId();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the unique ID of the packet. To indicate that a stanza has no id
|
||||
* pass <code>null</code> as the packet's id value.
|
||||
|
@ -132,16 +121,6 @@ public abstract class Stanza implements TopLevelStreamElement {
|
|||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the stanza ID.
|
||||
* @param packetID TODO javadoc me please
|
||||
* @deprecated use {@link #setStanzaId(String)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public void setPacketID(String packetID) {
|
||||
setStanzaId(packetID);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if this stanza has an ID set.
|
||||
*
|
||||
|
@ -179,26 +158,6 @@ public abstract class Stanza implements TopLevelStreamElement {
|
|||
return to;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets who the stanza is being sent "to". The XMPP protocol often makes
|
||||
* the "to" attribute optional, so it does not always need to be set.
|
||||
*
|
||||
* @param to who the stanza is being sent to.
|
||||
* @throws IllegalArgumentException if to is not a valid JID String.
|
||||
* @deprecated use {@link #setTo(Jid)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public void setTo(String to) {
|
||||
Jid jid;
|
||||
try {
|
||||
jid = JidCreate.from(to);
|
||||
}
|
||||
catch (XmppStringprepException e) {
|
||||
throw new IllegalArgumentException(e);
|
||||
}
|
||||
setTo(jid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets who the packet is being sent "to". The XMPP protocol often makes
|
||||
* the "to" attribute optional, so it does not always need to be set.
|
||||
|
@ -221,27 +180,6 @@ public abstract class Stanza implements TopLevelStreamElement {
|
|||
return from;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets who the stanza is being sent "from". The XMPP protocol often
|
||||
* makes the "from" attribute optional, so it does not always need to
|
||||
* be set.
|
||||
*
|
||||
* @param from who the stanza is being sent to.
|
||||
* @throws IllegalArgumentException if from is not a valid JID String.
|
||||
* @deprecated use {@link #setFrom(Jid)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public void setFrom(String from) {
|
||||
Jid jid;
|
||||
try {
|
||||
jid = JidCreate.from(from);
|
||||
}
|
||||
catch (XmppStringprepException e) {
|
||||
throw new IllegalArgumentException(e);
|
||||
}
|
||||
setFrom(jid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets who the packet is being sent "from". The XMPP protocol often
|
||||
* makes the "from" attribute optional, so it does not always need to
|
||||
|
@ -263,17 +201,6 @@ public abstract class Stanza implements TopLevelStreamElement {
|
|||
return error;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the error for this packet.
|
||||
*
|
||||
* @param error the error to associate with this packet.
|
||||
* @deprecated use {@link #setError(org.jivesoftware.smack.packet.StanzaError.Builder)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public void setError(StanzaError error) {
|
||||
this.error = error;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the error for this stanza.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue