Enum Class CompositionRepresentation

java.lang.Object
java.lang.Enum<CompositionRepresentation>
org.ehrbase.rest.openehr.format.CompositionRepresentation
All Implemented Interfaces:
Serializable, Comparable<CompositionRepresentation>, Constable

public enum CompositionRepresentation extends Enum<CompositionRepresentation>
Defines all supported combinations of MediaTypes with its corresponding CompositionFormats. To select an available CompositionRepresentation use the selectFromMediaTypeWithFormat(MediaType, CompositionFormat) function.
  • Enum Constant Details

  • Field Details

    • format

      public final org.ehrbase.openehr.sdk.response.dto.ehrscape.CompositionFormat format
      The actual format of the composition
    • mediaType

      public final org.springframework.http.MediaType mediaType
      The used Content-Type of the composition
  • Method Details

    • values

      public static CompositionRepresentation[] 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 CompositionRepresentation 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
    • selectFromMediaTypeWithFormat

      public static CompositionRepresentation selectFromMediaTypeWithFormat(org.springframework.http.MediaType mediaType, org.ehrbase.openehr.sdk.response.dto.ehrscape.CompositionFormat format)
      Selects the supported CompositionRepresentation from the given MediaType in combination with the provided CompositionFormat.
      Parameters:
      mediaType - of the serialized composition
      format - of the composition use for serialization and/or deserialization
      Returns:
      CompositionRepresentation of a composition to use
      Throws:
      InvalidApiParameterException - when the given format is not supported at all.
      NotAcceptableException - when content type or composition format is not supported or the input is invalid.