mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-09-09 10:19:41 +02:00
Merge branch '4.4'
This commit is contained in:
commit
59d3d75a71
10 changed files with 123 additions and 32 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