com.aspose.html

Class MimeType

  • java.lang.Object
    • com.aspose.html.MimeType
  • All Implemented Interfaces:
    com.aspose.ms.System.IEquatable<MimeType>


    public class MimeType
    extends java.lang.Object
    implements com.aspose.ms.System.IEquatable<MimeType>

    Represents an Internet Media Types

    See Also:
    IEquatable{MimeType}
    • Constructor Summary

      Constructors 
      Constructor and Description
      MimeType(java.lang.String value)
      Initializes a new instance of MIME type based on serialized string value.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean equals(MimeType other)
      Indicates whether the current object is equal to another object of the same type.
      boolean equals(java.lang.Object obj)
      Determines whether the specified Object is equal to the current Object.
      static java.lang.String extractFileExtension(MimeType mimeType)
      Extracts file extension from MIME type.
      static MimeType fromFileExtension(java.lang.String fileName)
      Creates a new MIME type based on file extension.
      java.lang.String getSubType()
      Gets the sub media type.
      java.lang.String getType()
      Gets the media type.
      int hashCode()
      Returns a hash code for this instance.
      static boolean op_Equality(MimeType a, MimeType b)
      Compares two Mime type and returns a boolean indicating if the two do match.
      static boolean op_Inequality(MimeType a, MimeType b)
      Compares two Mime type and returns a boolean indicating if the two do match.
      static MimeType to_MimeType(java.lang.String string)
      Performs an implicit conversion from String to MimeType.
      static java.lang.String to_String(MimeType type)
      Performs an implicit conversion from MimeType to String.
      java.lang.String toString()
      Returns a String that represents Mime type.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • MimeType

        public MimeType(java.lang.String value)

        Initializes a new instance of MIME type based on serialized string value.

        Parameters:
        value - The value.
    • Method Detail

      • op_Equality

        public static boolean op_Equality(MimeType a,
                                          MimeType b)

        Compares two Mime type and returns a boolean indicating if the two do match.

        Parameters:
        a - The first Mime to compare.
        b - The second Mime to compare. Value: TrueValue: false
        Returns:
        if both priorities are equal, otherwise .
      • op_Inequality

        public static boolean op_Inequality(MimeType a,
                                            MimeType b)

        Compares two Mime type and returns a boolean indicating if the two do match.

        Parameters:
        a - The first Mime to compare.
        b - The second Mime to compare. Value: TrueValue: false
        Returns:
        if both priorities are not equal, otherwise .
      • to_MimeType

        public static MimeType to_MimeType(java.lang.String string)

        Performs an implicit conversion from String to MimeType.

        Parameters:
        string - The string.
        Returns:
        The result of the conversion.
      • to_String

        public static java.lang.String to_String(MimeType type)

        Performs an implicit conversion from MimeType to String.

        Parameters:
        type - The mime type.
        Returns:
        The result of the conversion.
      • fromFileExtension

        public static MimeType fromFileExtension(java.lang.String fileName)

        Creates a new MIME type based on file extension.

        Parameters:
        fileName - The name of the file.
        Returns:
        The new instance of MIME type
      • extractFileExtension

        public static java.lang.String extractFileExtension(MimeType mimeType)

        Extracts file extension from MIME type.

        Parameters:
        mimeType - The MIME type.
        Returns:
        File extension.
      • getType

        public java.lang.String getType()

        Gets the media type.

        Value: The media type.
      • getSubType

        public java.lang.String getSubType()

        Gets the sub media type.

        Value: The sub media type.
      • equals

        public boolean equals(MimeType other)

        Indicates whether the current object is equal to another object of the same type.

        Parameters:
        other - An object to compare with this object.
        Returns:
        true if the current object is equal to the other parameter; otherwise, false.
      • equals

        public boolean equals(java.lang.Object obj)

        Determines whether the specified Object is equal to the current Object.

        Specified by:
        equals in interface com.aspose.ms.System.IEquatable<MimeType>
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - The Object to compare with the current Object.
        Returns:
        true if the specified Object is equal to the current Object; otherwise, false.
      • hashCode

        public int hashCode()

        Returns a hash code for this instance.

        Overrides:
        hashCode in class java.lang.Object
        Returns:
        A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
      • toString

        public java.lang.String toString()

        Returns a String that represents Mime type.

        Overrides:
        toString in class java.lang.Object
        Returns:
        A String that represents this instance.