DocumentFormatBase

Inheritance: java.lang.Object, com.groupdocs.editor.formats.abstraction.FormatFamilyBase

All Implemented Interfaces: com.groupdocs.editor.formats.abstraction.IDocumentFormat

public abstract class DocumentFormatBase extends FormatFamilyBase implements IDocumentFormat

Represents the base class for document formats, providing common functionality for format instances.

Methods

Method Description
getMime() Gets the MIME type of the document format.
getExtension() Gets the file extension of the document format.
getFormatFamily() Gets the format family to which the document format belongs.
fromMime(Class clazz, String mime) Retrieves an instance of the specified type
T
that has the specified MIME type.
hashCode() Returns a hash code for the current object.
equals(IDocumentFormat other) Determines whether this instance is equal to the specified IDocumentFormat instance.
equals(Object obj) Determines whether this instance is equal to the specified DocumentFormatBase instance.
toString(DocumentFormatBase extension) Converts a DocumentFormatBase instance to a string implicitly.

getMime()

public final String getMime()

Gets the MIME type of the document format.

Returns: java.lang.String

getExtension()

public final String getExtension()

Gets the file extension of the document format.

Returns: java.lang.String

getFormatFamily()

public final FormatFamilies getFormatFamily()

Gets the format family to which the document format belongs.

Returns: FormatFamilies

fromMime(Class clazz, String mime)

public static T <T>fromMime(Class<T> clazz, String mime)

Retrieves an instance of the specified type T that has the specified MIME type.

Parameters:

Parameter Type Description
clazz java.lang.Class
mime java.lang.String The MIME type of the document format.
T
The type of document format. |

Returns: T - An instance of the specified type T with the specified MIME type.

hashCode()

public int hashCode()

Returns a hash code for the current object.

Returns: int - A hash code for the current object, combining the hash codes of the base object, MIME type, file extension, and format family.

equals(IDocumentFormat other)

public final boolean equals(IDocumentFormat other)

Determines whether this instance is equal to the specified IDocumentFormat instance.

Parameters:

Parameter Type Description
other IDocumentFormat The IDocumentFormat instance to compare with the current instance.

Returns: boolean - true if the specified IDocumentFormat is equal to the current instance; otherwise, false .

equals(Object obj)

public boolean equals(Object obj)

Determines whether this instance is equal to the specified DocumentFormatBase instance.

Parameters:

Parameter Type Description
obj java.lang.Object The DocumentFormatBase instance to compare with the current instance.

Returns: boolean - true if the specified DocumentFormatBase is equal to the current instance; otherwise, false .

toString(DocumentFormatBase extension)

public static String toString(DocumentFormatBase extension)

Converts a DocumentFormatBase instance to a string implicitly.

Parameters:

Parameter Type Description
extension DocumentFormatBase The DocumentFormatBase instance to convert.

Returns: java.lang.String - The file extension of the DocumentFormatBase instance.