public final class DataUtils extends Object
Modifier and Type | Method and Description |
---|---|
static <T> T |
nullableEmptyResult(@Nullable Collection<T> results)
Return a single result object from the given Collection.
|
static <T> T |
nullableSingleResult(@Nullable Collection<T> results)
Return a single result object from the given Collection.
|
@Nullable public static <T> T nullableSingleResult(@Nullable @Nullable Collection<T> results) throws IncorrectDataSizeException
Throws an exception if 0 or more than 1 element found.
results
- the result Collection (can be null
and is also expected to contain null
elements)IncorrectDataSizeException
- if the given collection doesn't contain exactly 1 element@Nullable public static <T> T nullableEmptyResult(@Nullable @Nullable Collection<T> results)
Throws an exception if more than 1 element found.
results
- the result Collection (can be null
and is also expected to contain null
elements)IncorrectDataSizeException
- if the given collection contains more than 1 elementCopyright © 2021. All rights reserved.