Class CmsClientCollectionUtil

java.lang.Object
org.opencms.gwt.client.util.CmsClientCollectionUtil

public final class CmsClientCollectionUtil extends Object
A utility class with functions for dealing with maps.

Since:
8.0.0
  • Method Details

    • intersection

      public static <A> Set<A> intersection(Set<A> first, Set<A> second)
      Returns the intersection of two sets without modifying the original sets.

      Type Parameters:
      A - the type of objects contained in the sets
      Parameters:
      first - the first set
      second - the second set
      Returns:
      the intersection of both sets
    • isEmptyOrNull

      public static boolean isEmptyOrNull(Collection<?> collection)
      Checks whether a collection is empty or null.

      Parameters:
      collection - a collection
      Returns:
      true if collection is null or empty.
    • parseProperties

      public static Map<String,String> parseProperties(String text)
      Parses properties from a string and returns them in a map.

      Parameters:
      text - the text containing the properties
      Returns:
      the map with the parsed properties
    • removeNullEntries

      public static <A, B> Map<A,B> removeNullEntries(Map<A,B> map)
      Returns a new map with all entries of the input map except those which have a value of null.

      Type Parameters:
      A - the key type of the map
      B - the value type of the map
      Parameters:
      map - the input map
      Returns:
      a map with all null entries removed
    • updateMapAndRemoveNulls

      public static <A, B> void updateMapAndRemoveNulls(Map<A,B> source, Map<A,B> target)
      Copies entries from one map to another and deletes those entries in the target map for which the value in the source map is null.

      Type Parameters:
      A - the key type of the map
      B - the value type of the map
      Parameters:
      source - the source map
      target - the target map