com.aspose.html

Class MimeType

  • All Implemented Interfaces:
    com.aspose.ms.System.IEquatable<MimeType>


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

    Represents an Internet Media Types

    See Also:
    System.IEquatable{Aspose.HTML.MimeType}
    • Constructor Detail

      • MimeType

        public MimeType(String value)

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

        Parameters:
        value - The value.
    • Method Detail

      • getType

        public String getType()

        Gets the media type.

        Value: The media type.
      • getSubType

        public 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(Object obj)

        Determines whether the specified T:System.Object is equal to the current T:System.Object.

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

        public int hashCode()

        Returns a hash code for this instance.

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

        public String toString()

        Returns a System.String that represents Mime type.

        Overrides:
        toString in class Object
        Returns:
        A System.String that represents this instance.
      • 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(String string)

        Performs an implicit conversion from System.String to MimeType.

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

        public static String to_String(MimeType type)

        Performs an implicit conversion from MimeType to System.String.

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

        public static MimeType fromFileExtension(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