All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.softicar.platform.common.io.mime.IMimeType Maven / Gradle / Ivy

Go to download

The SoftiCAR Platform is a lightweight, Java-based library to create interactive business web applications.

There is a newer version: 50.0.0
Show newest version
package com.softicar.platform.common.io.mime;

/**
 * Interface for media type descriptions.
 *
 * @author Alexander Schmidt
 * @author Oliver Richers
 */
public interface IMimeType {

	/**
	 * Returns the standardized identifier of this media type.
	 *
	 * @return the media type identifier
	 */
	String getIdentifier();

	/**
	 * Determines whether this {@link IMimeType} is equal to the given
	 * {@link IMimeType}.
	 *
	 * @param otherMimeType
	 *            the {@link IMimeType} to check against (never null)
	 * @return true if the types are the same; false otherwise
	 */
	default boolean is(IMimeType otherMimeType) {

		return getIdentifier().toLowerCase().equals(otherMimeType.getIdentifier().toLowerCase());
	}

	static IMimeType createCustom(String customMimeType) {

		return new CustomMimeType(customMimeType);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy