Class MetadataCollection

All Implemented Interfaces:
Serializable, Cloneable, Iterable<MetadataElement>, Collection<MetadataElement>, List<MetadataElement>, RandomAccess

public class MetadataCollection extends ArrayList<MetadataElement>
A container class for handling a Collection of MetadataElement instance.
See Also:

In the adapter configuration file this class is aliased as metadata-collection which is the preferred alternative to the fully qualified classname when building your configuration.

  • Constructor Details

    • MetadataCollection

      public MetadataCollection()
    • MetadataCollection

      public MetadataCollection(@NotNull @NotNull Set<MetadataElement> elements)
    • MetadataCollection

      public MetadataCollection(@NotNull @NotNull MetadataCollection metadataCollection)
    • MetadataCollection

      public MetadataCollection(@NotNull @NotNull KeyValuePairBag elements)
    • MetadataCollection

      public MetadataCollection(@NotNull @NotNull Map<String,String> elements)
    • MetadataCollection

      public MetadataCollection(@NotNull @NotNull MetadataElement... elements)
  • Method Details

    • toSet

      public Set<MetadataElement> toSet()
      Will create an return a new Set from this MetadataCollection
      Returns:
      a set of metadata elements.
    • containsKey

      public boolean containsKey(String key)
      Simple utility method that will scan the MetadataElement's and will check the each key equals the supplied key. Note, this method id case sensitive.
      Parameters:
      key - the key to search for.
      Returns:
      true if the collection contains this key.
    • asSet

      public static Set<MetadataElement> asSet(Collection<MetadataElement> col)
      Helper to turn a metadata elements into Set.
      Parameters:
      col - the collection
      Returns:
      a Set
    • asProperties

      public static Properties asProperties(Collection<MetadataElement> col)
      Helper to turn a set of metadata elements into Properties.
      Parameters:
      col - the collection
      Returns:
      a Properties
    • asMap

      public static Map<String,String> asMap(Collection<MetadataElement> col)
      Helper to turn a set of metadata elements into Map.
      Parameters:
      col - the collection
      Returns:
      a Map