Class Directory

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    it.tidalwave.image.metadata.EXIFDirectoryGenerated, it.tidalwave.image.metadata.IPTCDirectoryGenerated, MakerNote, XMP

    public class Directory
    extends JavaBeanSupport
    implements java.io.Serializable
    This class provides basic support for all of kind of metadata such EXIF, IPTC or maker notes.
    Author:
    Fabrizio Giudici
    See Also:
    Serialized Form
    • Constructor Detail

      • Directory

        public Directory()
      • Directory

        public Directory​(java.time.Instant latestModificationTime)
    • Method Detail

      • getTagCodes

        public int[] getTagCodes()
      • getSubDirectoryNames

        public java.util.Set<java.lang.String> getSubDirectoryNames()
      • getSubDirectory

        public Directory getSubDirectory​(java.lang.String name)
      • getObject

        public java.lang.Object getObject​(int tag)
        Returns an original tag value (i.e. exactly as it is stored into the file).
        Parameters:
        tag - the tag to retrieve
        Returns:
        the value
      • getObject

        @CheckForNull
        public <T> java.util.Optional<T> getObject​(int tag,
                                                   @Nonnull
                                                   java.lang.Class<T> asType)
        Returns a tag value converted to the specified type.
        Parameters:
        tag - the tag to retrieve
        asType - the type to convert the value into
        Returns:
        the value
      • setObject

        public void setObject​(int tag,
                              java.lang.Object value)
      • containsTag

        public boolean containsTag​(int tag)
        Parameters:
        tag -
        Returns:
      • removeTag

        public void removeTag​(int tag)
        Parameters:
        tag -
      • getTagName

        @Nonnull
        public java.lang.String getTagName​(int tag)
        Parameters:
        tag -
        Returns:
      • getLatestModificationTime

        public java.time.Instant getLatestModificationTime()
      • isAvailable

        public boolean isAvailable()
      • touch

        protected void touch()
      • toString

        @Nonnull
        public final java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toString

        public java.lang.String toString​(byte[] array)
        Parameters:
        array -
        Returns:
      • equals

        public final boolean equals​(java.lang.Object object)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString​(Rational[] array)
        Parameters:
        array -
        Returns:
      • isSubClass

        protected boolean isSubClass​(java.lang.Class aClass,
                                     java.lang.String ancestorClassName)
        Returns:
      • formatDateTime

        protected static java.lang.String formatDateTime​(java.time.Instant date)
      • parseDateTime

        protected static java.time.Instant parseDateTime​(java.lang.String string)