Class DefaultNullListConversionStrategies

java.lang.Object
org.hawaiiframework.converter.DefaultNullListConversionStrategies

public final class DefaultNullListConversionStrategies extends Object
A few default implementations for the NullListConversionStrategy.
  • Method Details

    • raiseError

      public static <T> NullListConversionStrategy<T> raiseError(Class<T> ignored)
      Raise an IllegalArgumentException that 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.