1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-29 09:42:06 +01:00

Add new RSMSet constructors

and fix typo in RSMSetManager
This commit is contained in:
Florian Schmaus 2014-09-20 16:52:08 +02:00
parent 5a9e353f2c
commit bd0fb973c8
2 changed files with 13 additions and 1 deletions

View file

@ -33,7 +33,7 @@ public class RSMManager {
return packetExtensions; return packetExtensions;
} }
Collection<PacketExtension> contiunePage(int max, Collection<PacketExtension> returnedExtensions) { Collection<PacketExtension> continuePage(int max, Collection<PacketExtension> returnedExtensions) {
return continuePage(max, returnedExtensions, null); return continuePage(max, returnedExtensions, null);
} }

View file

@ -47,6 +47,10 @@ public class RSMSet implements PacketExtension {
this(null, null, -1, index, null, max, null, -1); this(null, null, -1, index, null, max, null, -1);
} }
public RSMSet(String item, PageDirection pageDirection) {
this(-1, item, pageDirection);
}
public RSMSet(int max, String item, PageDirection pageDirection) { public RSMSet(int max, String item, PageDirection pageDirection) {
switch (pageDirection) { switch (pageDirection) {
case before: case before:
@ -146,4 +150,12 @@ public class RSMSet implements PacketExtension {
public static RSMSet from(Packet packet) { public static RSMSet from(Packet packet) {
return (RSMSet) packet.getExtension(ELEMENT, NAMESPACE); return (RSMSet) packet.getExtension(ELEMENT, NAMESPACE);
} }
public static RSMSet newAfter(String after) {
return new RSMSet(after, PageDirection.after);
}
public static RSMSet newBefore(String before) {
return new RSMSet(before, PageDirection.before);
}
} }