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

Use switch-case in Roster.hasValidSubscriptionType()

This commit is contained in:
Florian Schmaus 2015-01-05 23:53:00 +01:00
parent 61cc6a36da
commit d7d4c8a4fd

View file

@ -844,10 +844,15 @@ public class Roster {
* This is used by {@link RosterPushListener} and {@link RosterResultListener}.
* */
private static boolean hasValidSubscriptionType(RosterPacket.Item item) {
return item.getItemType().equals(RosterPacket.ItemType.none)
|| item.getItemType().equals(RosterPacket.ItemType.from)
|| item.getItemType().equals(RosterPacket.ItemType.to)
|| item.getItemType().equals(RosterPacket.ItemType.both);
switch (item.getItemType()) {
case none:
case from:
case to:
case both:
return true;
default:
return false;
}
}
private boolean isRosterVersioningSupported() {