Class FileFormatImpl

  • All Implemented Interfaces:
    FileFormat

    public class FileFormatImpl
    extends java.lang.Object
    implements FileFormat

    Default implementation of FileFormat

    Since:
    1.0
    Version:
    1.0
    Author:
    Michael Grove
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.List<java.lang.String> mFileExtensions  
      protected java.util.List<java.lang.String> mMimetypes  
      protected java.lang.String mName  
    • Constructor Summary

      Constructors 
      Constructor Description
      FileFormatImpl​(java.lang.String theName, java.util.List<java.lang.String> theMimetypes, java.util.List<java.lang.String> theFileExtensions)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String defaultExtension()
      Return the default file extension for this format
      java.lang.String defaultMimeType()
      Return the default mimetype for this format
      java.util.stream.Stream<java.lang.String> extensions()
      Return all supported file format extensions
      java.util.stream.Stream<java.lang.String> mimeTypes()
      Return all supported mimetypes of this format
      java.lang.String name()
      The friendly format name
      java.lang.String toString()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • mName

        protected final java.lang.String mName
      • mMimetypes

        protected final java.util.List<java.lang.String> mMimetypes
      • mFileExtensions

        protected final java.util.List<java.lang.String> mFileExtensions
    • Constructor Detail

      • FileFormatImpl

        public FileFormatImpl​(@Nonnull
                              java.lang.String theName,
                              @Nonnull
                              java.util.List<java.lang.String> theMimetypes,
                              @Nonnull
                              java.util.List<java.lang.String> theFileExtensions)
    • Method Detail

      • name

        @Nonnull
        public java.lang.String name()
        The friendly format name
        Specified by:
        name in interface FileFormat
        Returns:
        the name
      • defaultExtension

        @Nonnull
        public java.lang.String defaultExtension()
        Return the default file extension for this format
        Specified by:
        defaultExtension in interface FileFormat
        Returns:
        the default file extension
      • defaultMimeType

        @Nonnull
        public java.lang.String defaultMimeType()
        Return the default mimetype for this format
        Specified by:
        defaultMimeType in interface FileFormat
        Returns:
        the default mimetype
      • extensions

        @Nonnull
        public java.util.stream.Stream<java.lang.String> extensions()
        Return all supported file format extensions
        Specified by:
        extensions in interface FileFormat
        Returns:
        the extensions
      • mimeTypes

        @Nonnull
        public java.util.stream.Stream<java.lang.String> mimeTypes()
        Return all supported mimetypes of this format
        Specified by:
        mimeTypes in interface FileFormat
        Returns:
        the mimetypes
      • toString

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