Class FdResponse<R extends org.hl7.fhir.r4.model.Resource>

java.lang.Object
de.gematik.bbriccs.rest.fd.FdResponse<R>

public final class FdResponse<R extends org.hl7.fhir.r4.model.Resource> extends Object
  • Method Details

    • forPayload

      public static <E extends org.hl7.fhir.r4.model.Resource> FdResponse.ErpResponseBuilder<E> forPayload(Class<E> expectType, @Nullable org.hl7.fhir.r4.model.Resource resource)
    • isValidPayload

      public boolean isValidPayload()
    • getAsBaseResource

      @Nullable public org.hl7.fhir.r4.model.Resource getAsBaseResource()
      This will retrieve the FHIR Payload Resource as the Base-Class without any validation.
      Returns:
      the FHIR Payload as an untyped Resource
    • getAsOperationOutcome

      public org.hl7.fhir.r4.model.OperationOutcome getAsOperationOutcome()
    • getExpectedResource

      public R getExpectedResource()
    • getExpectedOrThrow

      public <E extends RuntimeException> R getExpectedOrThrow(Function<FdResponse<? extends org.hl7.fhir.r4.model.Resource>,E> errorFunction)
      Extract the Resource from the Response or throw a custom Exception if the Resource is not of the expected type
      Type Parameters:
      E - the type of the custom exception to be thrown if the Resource is not of the expected type
      Parameters:
      errorFunction - mapping the ErpResponse to a custom Exception
      Returns:
      the Resource
    • getResourceOptional

      public Optional<R> getResourceOptional()
    • getResourceOptional

      public <U extends org.hl7.fhir.r4.model.Resource> Optional<U> getResourceOptional(Class<U> clazz)
    • getResourceType

      public Class<? extends org.hl7.fhir.r4.model.Resource> getResourceType()
    • isResourceOfType

      public boolean isResourceOfType(Class<? extends org.hl7.fhir.r4.model.Resource> clazz)
    • isOfExpectedType

      public boolean isOfExpectedType()
    • isOperationOutcome

      public boolean isOperationOutcome()
    • isEmptyBody

      public boolean isEmptyBody()
    • getHeaderValue

      public String getHeaderValue(HttpHeaderKey key)
    • getHeaderValue

      public String getHeaderValue(String key)
    • getContentType

      public MediaType getContentType()
    • getContentLength

      public long getContentLength()
    • isJson

      public boolean isJson()
    • isXML

      public boolean isXML()
    • toString

      public String toString()
      Overrides:
      toString in class Object