Package org.hawaiiframework.converter
Class DefaultNullListConversionStrategies
- java.lang.Object
-
- org.hawaiiframework.converter.DefaultNullListConversionStrategies
-
public final class DefaultNullListConversionStrategies extends Object
A few default implementations for theNullListConversionStrategy.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> NullListConversionStrategy<T>raiseError(Class<T> ignored)Raise anIllegalArgumentExceptionthat the list is null.static <T> NullListConversionStrategy<T>returnEmptyList(Class<T> ignored)Return an empty list.static <T> NullListConversionStrategy<T>returnNull(Class<T> ignored)Return null.
-
-
-
Method Detail
-
raiseError
public static <T> NullListConversionStrategy<T> raiseError(Class<T> ignored)
Raise anIllegalArgumentExceptionthat the list is null.- Type Parameters:
T- The element type of the list to be returned.- Parameters:
ignored- The class, ignored, used for type casting.- Throws:
IllegalArgumentException- always
-
returnNull
public static <T> NullListConversionStrategy<T> returnNull(Class<T> ignored)
Return null.- Type Parameters:
T- The element type of the list to be returned.- Parameters:
ignored- The class, ignored, used for type casting.- Returns:
null, always.
-
returnEmptyList
public static <T> NullListConversionStrategy<T> returnEmptyList(Class<T> ignored)
Return an empty list.- Type Parameters:
T- The element type of the list to be returned.- Parameters:
ignored- The class, ignored, used for type casting.- Returns:
- An empty list.
-
-