Enum Class MediaType

java.lang.Object
java.lang.Enum<MediaType>
de.gematik.bbriccs.rest.fd.MediaType
All Implemented Interfaces:
Serializable, Comparable<MediaType>, Constable

public enum MediaType extends Enum<MediaType>
Diese Enumeration beschreibt die beiden gängigsten Media-Types (MIME) die von einem FHIR-Server bzw. FD erwartet werden.
  • Enum Constant Details

    • ACCEPT_FHIR_XML

      public static final MediaType ACCEPT_FHIR_XML
    • FHIR_XML

      public static final MediaType FHIR_XML
    • ACCEPT_FHIR_JSON

      public static final MediaType ACCEPT_FHIR_JSON
    • FHIR_JSON

      public static final MediaType FHIR_JSON
    • APPLICATION_JSON

      public static final MediaType APPLICATION_JSON
    • APPLICATION_XML

      public static final MediaType APPLICATION_XML
    • EMPTY

      public static final MediaType EMPTY
    • UNKNOWN

      public static final MediaType UNKNOWN
  • Method Details

    • values

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

      public static MediaType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • asString

      public String asString()
      Gibt die String-Repräsentation (MIME-Type) des enum wieder wie sie im Header eines Request/Response verwendet werden kann.
      Returns:
    • asString

      public String asString(boolean removeParameters)
      * Liefert den Accept-Type entweder alleine oder mit angefügten Parametern. * gemäß https://tools.ietf.org/html/rfc1945#section-3.6
      Parameters:
      removeParameters - entfernt mögliche Parameter hinter dem Accept-Type
      Returns:
      der Accept-Type als String
    • asString

      public String asString(boolean removeParameters, boolean removeApplication)
    • toFhirEncoding

      public de.gematik.bbriccs.fhir.EncodingType toFhirEncoding()
    • fromString

      public static MediaType fromString(String stringValue)
      Erstelle eine enum anhand des Strings der im Response-Header enthalten ist
      Parameters:
      stringValue - ist der 'content-type' Wert aus dem Response-Header
      Returns:
      ist der entsprechende ContentType als enum
    • isEquivalentTo

      public boolean isEquivalentTo(MediaType other)
    • toString

      public String toString()
      Overrides:
      toString in class Enum<MediaType>