Enum EMimeContentType

java.lang.Object
java.lang.Enum<EMimeContentType>
com.helger.commons.mime.EMimeContentType
All Implemented Interfaces:
IHasID<String>, Serializable, Comparable<EMimeContentType>, java.lang.constant.Constable

public enum EMimeContentType extends Enum<EMimeContentType> implements IHasID<String>
Determines the most well known MIME content types.
Author:
Philip Helger
  • Enum Constant Details

  • Method Details

    • values

      public static EMimeContentType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static EMimeContentType valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • getID

      @Nonnull @Nonempty public String getID()
      Description copied from interface: IHasID
      Get the unique ID of this object. If the type is String than the returned value must match an XML NMToken expression (so e.g. no ':' in the ID)!
      Specified by:
      getID in interface IHasID<String>
      Returns:
      The lower case text representation of this MIME content type.
    • getText

      @Nonnull @Nonempty public String getText()
      Returns:
      The lower case text representation of this MIME content type.
      See Also:
    • buildMimeType

      @Nonnull public MimeType buildMimeType(@Nonnull @Nonempty String sContentSubType)
      Build a new MimeType based on this MIME content type and the provided sub type.
      Parameters:
      sContentSubType - The content sub type to append. May neither be null nor empty.
      Returns:
      Never null.
    • isTypeOf

      public boolean isTypeOf(@Nullable String sMimeType)
      Check if the passed MIME type has the same content type as this
      Parameters:
      sMimeType - The MIME type string to be checked. May be null.
      Returns:
      true if the passed MIME type has this content type, false otherwise
    • getFromIDOrNull

      @Nullable public static EMimeContentType getFromIDOrNull(@Nullable String sID)