1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-12-12 05:51:08 +01:00

PacketExtension.from(Packet), deprecate getFrom()

add 'from(Packet)' to DataForm
This commit is contained in:
Florian Schmaus 2014-09-16 22:14:10 +02:00
parent f0651bae2d
commit 58e430af42
14 changed files with 158 additions and 13 deletions

View file

@ -69,9 +69,21 @@ public class DeliveryReceipt implements PacketExtension
*
* @param p the packet
* @return the {@link DeliveryReceipt} extension or {@code null}
* @deprecated use {@link #from(Packet)} instead
*/
@Deprecated
public static DeliveryReceipt getFrom(Packet p) {
return p.getExtension(ELEMENT, NAMESPACE);
return from(p);
}
/**
* Get the {@link DeliveryReceipt} extension of the packet, if any.
*
* @param packet the packet
* @return the {@link DeliveryReceipt} extension or {@code null}
*/
public static DeliveryReceipt from(Packet packet) {
return packet.getExtension(ELEMENT, NAMESPACE);
}
/**

View file

@ -51,9 +51,21 @@ public class DeliveryReceiptRequest implements PacketExtension
*
* @param p the packet
* @return the {@link DeliveryReceiptRequest} extension or {@code null}
* @deprecated use {@link #from(Packet)} instead
*/
@Deprecated
public static DeliveryReceiptRequest getFrom(Packet p) {
return p.getExtension(ELEMENT, DeliveryReceipt.NAMESPACE);
return from(p);
}
/**
* Get the {@link DeliveryReceiptRequest} extension of the packet, if any.
*
* @param packet the packet
* @return the {@link DeliveryReceiptRequest} extension or {@code null}
*/
public static DeliveryReceiptRequest from(Packet packet) {
return packet.getExtension(ELEMENT, DeliveryReceipt.NAMESPACE);
}
/**