Class MetadataExtractor.Metadata

  • Enclosing class:
    MetadataExtractor

    public final class MetadataExtractor.Metadata
    extends java.lang.Object
    A top-level object that holds the metadata values extracted from an image.

    Metadata objects may contain zero or more MetadataExtractor.Directory objects. Each directory may contain zero or more tags with corresponding values.

    Author:
    Drew Noakes https://drewnoakes.com
    • Constructor Detail

      • Metadata

        public Metadata()
    • Method Detail

      • getDirectoriesOfType

        public <T extends MetadataExtractor.Directory> java.util.Collection<T> getDirectoriesOfType​(java.lang.Class<T> type)
      • getDirectoryCount

        public int getDirectoryCount()
        Returns the count of directories in this metadata collection.
        Returns:
        the number of unique directory types set for this metadata collection
      • getFirstDirectoryOfType

        public <T extends MetadataExtractor.Directory> T getFirstDirectoryOfType​(java.lang.Class<T> type)
        Gets the first MetadataExtractor.Directory of the specified type contained within this metadata collection. If no instances of this type are present, null is returned.
        Type Parameters:
        T - the Directory type
        Parameters:
        type - the Directory type
        Returns:
        the first Directory of type T in this metadata collection, or null if none exist
      • hasErrors

        public boolean hasErrors()
        Indicates whether any errors were reported during the reading of metadata values. This value will be true if Directory.hasErrors() is true for one of the contained MetadataExtractor.Directory objects.
        Returns:
        whether one of the contained directories has an error
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object