Class CollectionUtilities

java.lang.Object
com.cedarsoftware.util.CollectionUtilities

public class CollectionUtilities extends Object
Author:
John DeRegnaucourt (jdereg@gmail.com)
Copyright (c) Cedar Software LLC

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

License

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
  • Constructor Details Link icon

    • CollectionUtilities Link icon

      public CollectionUtilities()
  • Method Details Link icon

    • isEmpty Link icon

      public static boolean isEmpty(Collection col)
      This is a null-safe isEmpty check.
      Parameters:
      col - Collection to check
      Returns:
      true if empty or null
    • hasContent Link icon

      public static boolean hasContent(Collection col)
      This is a null-safe isEmpty check.
      Parameters:
      col - Collection to check
      Returns:
      true if empty or null
    • size Link icon

      public static int size(Collection col)
      This is a null-safe size check.
      Parameters:
      col - Collection to check
      Returns:
      true if empty or null
    • listOf Link icon

      @SafeVarargs public static <T> List<T> listOf(T... items)
      For JDK1.8 support. Remove this and change to List.of() for JDK11+
    • setOf Link icon

      @SafeVarargs public static <T> Set<T> setOf(T... items)
      For JDK1.8 support. Remove this and change to Set.of() for JDK11+