public class KSCollectionUtils extends Object
| Constructor and Description |
|---|
KSCollectionUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
getOptionalZeroElement(List<T> list)
Cardinality of zero or one.
|
static <T> T |
getRequiredZeroElement(List<T> list)
Cardinality of one
This is a generic method so you will not need to worry about casting when using this method
Using get(0) in a non-test class will result in a critical sonar issue being reported which will result in a JIRA issue.
|
public KSCollectionUtils()
public static <T> T getRequiredZeroElement(List<T> list) throws OperationFailedException
T - Type of element to returnlist - Typed list passed into method. Cannot be null.OperationFailedExceptionpublic static <T> T getOptionalZeroElement(List<T> list) throws OperationFailedException
T - Type of element to returnlist - Typed list passed into method. Cannot be null.OperationFailedExceptionCopyright © 2004-2013 The Kuali Foundation. All Rights Reserved.