1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-26 16:22: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}. * This is used by {@link RosterPushListener} and {@link RosterResultListener}.
* */ * */
private static boolean hasValidSubscriptionType(RosterPacket.Item item) { private static boolean hasValidSubscriptionType(RosterPacket.Item item) {
return item.getItemType().equals(RosterPacket.ItemType.none) switch (item.getItemType()) {
|| item.getItemType().equals(RosterPacket.ItemType.from) case none:
|| item.getItemType().equals(RosterPacket.ItemType.to) case from:
|| item.getItemType().equals(RosterPacket.ItemType.both); case to:
case both:
return true;
default:
return false;
}
} }
private boolean isRosterVersioningSupported() { private boolean isRosterVersioningSupported() {