1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-09-09 10:19:41 +02:00

[xdata] Safe the raw character data of form field values

This commit is contained in:
Florian Schmaus 2021-07-18 17:21:50 +02:00
parent 4643d07ef4
commit 097d245358
9 changed files with 121 additions and 31 deletions

View file

@ -1,6 +1,6 @@
/**
*
* Copyright 2015-2020 Florian Schmaus
* Copyright 2015-2021 Florian Schmaus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -82,4 +82,11 @@ public class CollectionUtil {
}
return new HashSet<>(collection);
}
public static <T> List<T> emptyOrSingletonListFrom(T element) {
if (element == null) {
return Collections.emptyList();
}
return Collections.singletonList(element);
}
}