Class ListUtil

java.lang.Object
com.github.tadukoo.util.ListUtil

public final class ListUtil extends Object
Util functions for dealing with Lists.
Since:
Alpha v.0.1
Version:
Alpha v.0.2
Author:
Logan Ferree (Tadukoo)
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    Not allowed to create a ListUtil
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> List<T>
    createList(T... t)
    Creates a List using the given array of arguments.
    static boolean
    isBlank(List<?> list)
    Checks if the given List is blank (either null or an empty list).
    static boolean
    isNotBlank(List<?> list)
    Checks if the given List is NOT blank (blank = either null or an empty List).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ListUtil

      private ListUtil()
      Not allowed to create a ListUtil
  • Method Details

    • isBlank

      public static boolean isBlank(List<?> list)
      Checks if the given List is blank (either null or an empty list).
      Parameters:
      list - The List to check
      Returns:
      true if the List is null or empty
    • isNotBlank

      public static boolean isNotBlank(List<?> list)
      Checks if the given List is NOT blank (blank = either null or an empty List).
      Parameters:
      list - The List to check
      Returns:
      true if the List is not null and not empty
    • createList

      @SafeVarargs public static <T> List<T> createList(T... t)
      Creates a List using the given array of arguments. This is an improvement over Arrays.asList(T...) as it actually allows you to manipulate this List instead of having an immutable List.
      Type Parameters:
      T - The List's type argument and type of variables passed in
      Parameters:
      t - The array of variables passed in
      Returns:
      A List containing the given variables