Class MetaDataUtils


  • public final class MetaDataUtils
    extends java.lang.Object
    The MetaDataUtils class contains utility methods to deal with objects implementing the MetaData interface.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T extends MetaData>
      java.util.Map<java.lang.String,​T>
      toMap​(java.util.Collection<T> c)
      Takes MetaData objects from the specified collection and puts them to a map, where names of the objects are used as keys.
      static java.util.List<java.lang.String> toNameList​(java.util.Collection<? extends MetaData> c)
      Takes a collection of MetaData objects and creates a list containing their names.
      static java.lang.String toNameListString​(java.util.Collection<? extends MetaData> c, java.lang.String sep)
      Takes a collection of MetaData objects and creates a string that consists of their names separated with the specified separator string.
      static java.lang.String toNameListStringRecursive​(java.util.Collection<? extends MetaData> c, java.lang.String sep)
      Takes a collection of MetaData objects and creates a string that consists of their names separated with the specified separator string.
      static java.util.Set<java.lang.String> toNameSet​(java.util.Collection<? extends MetaData> c)
      Takes a collection of MetaData objects and creates a set containing their names.
      static java.util.Set<java.lang.String> toNameSetRecursive​(java.util.Collection<? extends MetaData> c)
      Takes a collection of MetaData objects and creates a set containing names of their elements.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • toMap

        public static <T extends MetaData> java.util.Map<java.lang.String,​T> toMap​(java.util.Collection<T> c)
        Takes MetaData objects from the specified collection and puts them to a map, where names of the objects are used as keys. The order of objects is preserved.
        Type Parameters:
        T - Exact type of MetaData objects.
        Parameters:
        c - Collection of MetaData objects.
        Returns:
        Map of MetaData objects.
      • toNameSet

        public static java.util.Set<java.lang.String> toNameSet​(java.util.Collection<? extends MetaData> c)
        Takes a collection of MetaData objects and creates a set containing their names. The order of objects is preserved.
        Parameters:
        c - Collection of MetaData objects.
        Returns:
        Set of MetaData object names.
      • toNameSetRecursive

        public static java.util.Set<java.lang.String> toNameSetRecursive​(java.util.Collection<? extends MetaData> c)
        Takes a collection of MetaData objects and creates a set containing names of their elements. If an object in the collection is represented by a group, its elements are added to the set in a recursive manner. The order of objects is preserved.
        Parameters:
        c - Collection of MetaData objects.
        Returns:
        Set of MetaData object names.
      • toNameList

        public static java.util.List<java.lang.String> toNameList​(java.util.Collection<? extends MetaData> c)
        Takes a collection of MetaData objects and creates a list containing their names. The order of objects is preserved.
        Parameters:
        c - Collection of MetaData objects.
        Returns:
        List of MetaData object names.
      • toNameListString

        public static java.lang.String toNameListString​(java.util.Collection<? extends MetaData> c,
                                                        java.lang.String sep)
        Takes a collection of MetaData objects and creates a string that consists of their names separated with the specified separator string. The order of objects is preserved.
        Parameters:
        c - Collection of MetaData objects.
        sep - Separator string.
        Returns:
        String containing a list of MetaData object names or empty string of the collection is empty.
      • toNameListStringRecursive

        public static java.lang.String toNameListStringRecursive​(java.util.Collection<? extends MetaData> c,
                                                                 java.lang.String sep)
        Takes a collection of MetaData objects and creates a string that consists of their names separated with the specified separator string. The order of objects is preserved. If objects in the collection represent groups, they are processed recursively to create a list of their items.
        Parameters:
        c - Collection of MetaData objects.
        sep - Separator string.
        Returns:
        String containing a list of MetaData object names or empty string of the collection is empty.