public final class MetaDataUtils
extends java.lang.Object
MetaDataUtils
class contains utility methods to deal with objects
implementing the MetaData
interface.Modifier and Type | Method and Description |
---|---|
static <T extends MetaData> |
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. |
public static <T extends MetaData> java.util.Map<java.lang.String,T> toMap(java.util.Collection<T> c)
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.T
- Exact type of MetaData
objects.c
- Collection of MetaData
objects.MetaData
objects.public static java.util.Set<java.lang.String> toNameSet(java.util.Collection<? extends MetaData> c)
MetaData
objects and creates a set containing
their names. The order of objects is preserved.c
- Collection of MetaData
objects.MetaData
object names.public static java.util.Set<java.lang.String> toNameSetRecursive(java.util.Collection<? extends MetaData> c)
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.c
- Collection of MetaData
objects.MetaData
object names.public static java.util.List<java.lang.String> toNameList(java.util.Collection<? extends MetaData> c)
MetaData
objects and creates a list containing
their names. The order of objects is preserved.c
- Collection of MetaData
objects.MetaData
object names.public static java.lang.String toNameListString(java.util.Collection<? extends MetaData> c, java.lang.String sep)
MetaData
objects and creates a string
that consists of their names separated with the specified separator string.
The order of objects is preserved.c
- Collection of MetaData
objects.sep
- Separator string.MetaData
object names or
empty string of the collection is empty.public static java.lang.String toNameListStringRecursive(java.util.Collection<? extends MetaData> c, java.lang.String sep)
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.c
- Collection of MetaData
objects.sep
- Separator string.MetaData
object names or
empty string of the collection is empty.