Package org.ehrbase.rest.openehr.format
Enum Class CompositionRepresentation
- All Implemented Interfaces:
Serializable,Comparable<CompositionRepresentation>,Constable
Defines all supported combinations of
MediaTypes with its corresponding CompositionFormats. To
select an available CompositionRepresentation use the
selectFromMediaTypeWithFormat(MediaType, CompositionFormat) function.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionA canonicalJSONrepresentation of a compositionA flatJSON(simSDT) representation of a compositionA structuredJSON(structSDT) representation of a compositionAnXMLrepresentation of a composition -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic CompositionRepresentationselectFromMediaTypeWithFormat(org.springframework.http.MediaType mediaType, org.ehrbase.openehr.sdk.response.dto.ehrscape.CompositionFormat format) Selects the supportedCompositionRepresentationfrom the givenMediaTypein combination with the providedCompositionFormat.static CompositionRepresentationReturns the enum constant of this class with the specified name.static CompositionRepresentation[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
XML
AnXMLrepresentation of a composition -
JSON
A canonicalJSONrepresentation of a composition -
JSON_STRUCTURED
A structuredJSON(structSDT) representation of a composition -
JSON_FLAT
A flatJSON(simSDT) representation of a composition
-
-
Field Details
-
format
public final org.ehrbase.openehr.sdk.response.dto.ehrscape.CompositionFormat formatThe actual format of the composition -
mediaType
public final org.springframework.http.MediaType mediaTypeThe usedContent-Typeof the composition
-
-
Method Details
-
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
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 nameNullPointerException- 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 supportedCompositionRepresentationfrom the givenMediaTypein combination with the providedCompositionFormat.- Parameters:
mediaType- of the serialized compositionformat- of the composition use for serialization and/or deserialization- Returns:
CompositionRepresentationof a composition to use- Throws:
InvalidApiParameterException- when the givenformatis not supported at all.NotAcceptableException- when content type or composition format is not supported or the input is invalid.
-