mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-09 17:19:39 +02:00
[xdata] Safe the raw character data of form field values
This commit is contained in:
parent
4643d07ef4
commit
097d245358
9 changed files with 121 additions and 31 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue