1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-25 21:42:07 +01:00

[disco] Add DisocverInfo.nullSafeContainsFuture(DiscoverInfo, CharSequence)

This commit is contained in:
Florian Schmaus 2021-09-27 13:55:52 +02:00
parent 1564b98d60
commit 49ad8c0954

View file

@ -258,6 +258,14 @@ public class DiscoverInfo extends IQ implements DiscoverInfoView {
return features.contains(new Feature(feature));
}
public static boolean nullSafeContainsFeature(DiscoverInfo discoverInfo, CharSequence feature) {
if (discoverInfo == null) {
return false;
}
return discoverInfo.containsFeature(feature);
}
@Override
protected IQChildElementXmlStringBuilder getIQChildElementBuilder(IQChildElementXmlStringBuilder xml) {
xml.optAttribute("node", getNode());